# Unity project for iOS

**URL:** https://discuss.bitrise.io/t/unity-project-for-ios/20873
**Category:** Question & Answer
**Tags:** ios
**Created:** [August 30, 2022, 9:29am UTC](https://discuss.bitrise.io/t/unity-project-for-ios/20873 "2022-08-30T09:29:30Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![tomasz.wozniak](https://avatars.discourse-cdn.com/v4/letter/t/858c86/32.png) [@tomasz.wozniak](https://discuss.bitrise.io/u/tomasz.wozniak)
#### Post date: [August 30, 2022, 9:29am UTC](https://discuss.bitrise.io/t/unity-project-for-ios/20873/1 "2022-08-30T09:29:30Z")

</div>

Hi,  
Could you please tell me, how to set up Bitrise for building iOS application with Unity on PC with Windows?  
I have found this: [How to build a Unity project](https://discuss.bitrise.io/t/how-to-build-a-unity-project/1317), but I fear it is outdated.

Thanks in advance for any help.

---

<div class="post-metadata">

### Author: ![damien.murphy](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/damien.murphy/32/4535_2.png) [@damien.murphy](https://discuss.bitrise.io/u/damien.murphy)
#### Post date: [August 30, 2022, 10:42pm UTC](https://discuss.bitrise.io/t/unity-project-for-ios/20873/2 "2022-08-30T22:42:37Z")

</div>

The workflow will differ by requirements but here is an example I have used in the past

```auto
---
format_version: '11'
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: other
workflows:
  primary:
    steps:
    - script@1:
        title: Download and Install Unity
        run_if: ".IsCI"
        inputs:
        - content: |
            #!/usr/bin/env bash
            set -ex

            #download unity pkg
            curl -o ./unity.pkg http://download.unity3d.com/download_unity/38b4efef76f0/MacEditorInstaller/Unity-5.5.0f3.pkg

            #download android support platform
            curl -o ./android.pkg http://download.unity3d.com/download_unity/38b4efef76f0/MacEditorTargetInstaller/UnitySetup-Android-Support-for-Editor-5.5.0f3.pkg

            #download iOS android support
            curl -o ./ios.pkg http://download.unity3d.com/download_unity/38b4efef76f0/MacEditorTargetInstaller/UnitySetup-iOS-Support-for-Editor-5.5.0f3.pkg

            #install unity pkg
            sudo -S installer -package ./unity.pkg -target / -verbose

            #install unity android support pkg
            sudo -S installer -package ./android.pkg -target / -verbose

            #install unity iOS support pkg
            sudo -S installer -package ./ios.pkg -target / -verbose
    - script@1:
        title: Activate Unity
        run_if: ".IsCI"
        inputs:
        - content: |
            #!/usr/bin/env bash
            set -ex

            /Applications/Unity/Unity.app/Contents/MacOS/Unity -logfile - &
            sleep 15
            sudo killall Unity

            /Applications/Unity/Unity.app/Contents/MacOS/Unity \
                -quit -noUpm -batchmode -logFile - \
                -serial ${UNITY_SERIAL} \
                -username ${UNITY_EMAIL} \
                -password ${UNITY_PW}
    - script@1:
        title: Build Android
        inputs:
        - content: |-
            #!/bin/bash
            # fail if any commands fails
            set -ex

            /Applications/Unity/Unity.app/Contents/MacOS/Unity -nographics -quit -batchmode -logFile -projectPath "$BITRISE_SOURCE_DIR" -executeMethod BitriseUnity.Build -androidSdkPath "$ANDROID_HOME" -buildOutput "$BITRISE_DEPLOY_DIR/mygame.apk" -buildPlatform android
    - script@1:
        title: Build iOS
        inputs:
        - content: |-
            #!/bin/bash
            # fail if any commands fails
            set -ex

            /Applications/Unity/Unity.app/Contents/MacOS/Unity -nographics -quit -batchmode -logFile -projectPath "$BITRISE_SOURCE_DIR" -executeMethod BitriseUnity.Build -buildOutput "$BITRISE_SOURCE_DIR/xcodebuild" -buildPlatform ios
    - script@1:
        title: Return Unity license
        is_always_run: true
        run_if: ".IsCI"
        inputs:
        - content: |-
            #!/usr/bin/env bash
            set -ex

            /Applications/Unity/Unity.app/Contents/MacOS/Unity \
                -quit -noUpm -batchmode -logFile - \
                -returnlicense
meta:
  bitrise.io:
    stack: osx-xcode-13.4.x
    machine_type_id: g2.4core

```

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex016/uploads/bitrise/original/2X/d/d901cf2aad020f2dd11918afc89ec2089bb87b35.png) [@system](https://discuss.bitrise.io/u/system)
#### Post date: [September 29, 2022, 10:43pm UTC](https://discuss.bitrise.io/t/unity-project-for-ios/20873/3 "2022-09-29T22:43:05Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
