



google_play # <- (Includes GCLOUD_SERVICE_ACCOUNT_CREDENTIALS <- Put your google-services.json) vars: unity # <- (Includes UNITY_HOME, UNITY_SERIAL, UNITY_EMAIL and UNITY_PASSWORD) # Add the group environment variables in Codemagic UI (in Application or Team variables). Name: Unity Android Workflow instance_type: mac_pro max_build_duration: 120 environment: The example below uses Unity Hub CLI commands to install the specified Unity version as well as the Android and iOS Build Support modules. Unity installation scriptĪfter activating the Unity license as usual, add the following script to install the desired version and modules you wish to use. Unity Hub CLI commands do not work correctly if a license is not already active on the machine. name: Retrieve Used Unity Version script: | $env:UNITY_VERSION=(Get-Content ProjectSettings/ProjectVersion.txt -TotalCount 1).Substring(17) $env:UNITY_VERSION_CHANGESET=( "\((.*)\)").match((Get-Content ProjectSettings/ProjectVersion.txt -TotalCount 2)).groups.value Add-Content -Path $env:CM_ENV -Value "UNITY_VERSION=$UNITY_VERSION" Add-Content -Path $env:CM_ENV -Value "UNITY_VERSION_CHANGESET=$UNITY_VERSION_CHANGESET" Add-Content -Path $env:CM_ENV -Value "UNITY_HOME=C:\Program Files\Unity\Hub\Editor\$env:UNITY_VERSION\Editor" Activating UnityĮven though you are installing a different version of Unity to build your apps with, you should activate your license using the default Unity version already installed on the machine. In order to install a different version, you can use the info from the ProjectSettings/ProjectVersion.txt file which has the unity version and changeset that the project uses. Getting the Unity version number and changeset id License activation and return takes place with the Unity version already installed on the machine, but building of the Xcode project or Android binary will use the version of Unity you install. It is possible to use the Unity Hub CLI to download and install a different Unity Editor version and target support files for that version. If your app requires additional modules then you need to install it using Unity Hub CLI like this: /Applications/Unity\ Hub.app/Contents/MacOS/Unity\ Hub -headless install-modules -version -m windows-mono, this will install the windows modules for the specified.These versions are the Unity Editor (macOS x86_64), and have only the macOS, Android, and iOS modules.
