Skip to main content

About the Unity Setup Task

Use this task to setup the Unity editor / installation on the build agent and configure platform modules. This task is especially useful when building using a hosted agent, where the Unity version required for your project to build might not be installed at all or not configured properly for your project.

Another purpose of this task is to activate a license / seat on the agent, should your project require it to build. Make sure to use a license with at least one seat activation available. By default, the task will release the seat again after the pipeline has completed.

Syntax

# Unity Setup Task V2
# Install Unity editor with Android module
- task: UnitySetupTask@2
inputs:
installAndroidModule: true

Inputs

unityHubExecutableLocation

For the task to run successfully it needs to know where the Unity Hub executable can be found on the agent. This input defines where to look for it.

YAMLClassic EditorRequiredDefault
unityHubExecutableLocationUnity Hub executable locationYesdefault

Options:

ValueDescription
defaultUses the Unity Hub default installation path to look up the Unity Hub executable
specifyLet's you specify a custom path where to look for the Unity Hub executable. See also input customUnityHubExecutableLocation

customUnityHubExecutableLocation

Should you have configured unityEditorsPathMode to specify, this input is used to read your custom path.

YAMLClassic EditorRequiredDefault
customUnityHubExecutableLocationCustom Unity Hub executable pathYes, if unityHubExecutableLocation is specify-

versionSelectionMode

This input defines how to determine the Unity version required to build the project on in the context of this task, which Unity editor version to install and / or actigvate a license with.

YAMLClassic EditorRequiredDefault
versionSelectionModeUnity versionYesproject

Options:

ValueDescription
projectUses exactly the Unity version that the project was last opened with
specifyLet's you specify a Unity version to work with. See also input version and revision

version

The version of the Unity editor to work with, e.g. 6000.0.30f1. You can determine the version for your project using the ProjectVersion.txt file within your project's ProjectSettings folder.

YAMLClassic EditorRequiredDefault
versionVersionYes, if versionSelectionMode is specify-

revision

The revision of the Unity editor to work with, e.g. 62b05ba0686a. You can determine the revision for your project using the ProjectVersion.txt file within your project's ProjectSettings folder.

YAMLClassic EditorRequiredDefault
revisionRevisionYes, if versionSelectionMode is specify-

unityProjectPath

Enter the directory path to the Unity project. If no value is entered, the project is assumed to be in the repository root. Use this input, if your Unity project is nested within subfolders within your repository.

YAMLClassic EditorRequiredDefault
unityProjectPathUnity project pathNo-

installEditor

If set, the task will check whether the required Unity editor is installed on the agent and install if needed. Disable this if you know the editor is preinstalled and you want to skip this setup step.

YAMLClassic EditorRequiredDefault
installEditorInstall / verify editor and configurationNotrue

Options:

ValueDescription
trueInstall editor and modules, if not already installed
falseSkip installation

macOSArchitecture

This input is only relevant when building using a macOS agent. Select the editor architecture to install, in case installEditor is enabled.

YAMLClassic EditorRequiredDefault
macOSArchitectureEditor Architecture (macOS only!)Nox86_64

Options:

ValueDescription
x86_64Intel
arm64Apple Silicon

installAndroidModule

Install the Android build module.

YAMLClassic EditorRequiredDefault
installAndroidModuleAndroid Build SupportNofalse

Options:

ValueDescription
trueInstall the module
falseDo not install the module

installAndroidChildModules

Installs Android SDK & NDK Tools as well as the OpenJDK module.

YAMLClassic EditorRequiredDefault
installAndroidChildModulesInstall Android SDK & NDK Tools & OpenJDKNotrue

Options:

ValueDescription
trueInstall the module
falseDo not install the module

installIOSModule

Install the iOS build module.

YAMLClassic EditorRequiredDefault
installIOSModuleiOS Build SupportNofalse

Options:

ValueDescription
trueInstall the module
falseDo not install the module

installTVOSModule

Install the tvOS build module.

YAMLClassic EditorRequiredDefault
installTVOSModuletvOS Build SupportNofalse

Options:

ValueDescription
trueInstall the module
falseDo not install the module

installVisionOSModule

Install the visionOS build module.

YAMLClassic EditorRequiredDefault
installVisionOSModulevisionOS Build SupportNofalse

Options:

ValueDescription
trueInstall the module
falseDo not install the module

installLinuxMonoModule

Install the Linux build module.

YAMLClassic EditorRequiredDefault
installLinuxMonoModuleLinux Build SupportNofalse

Options:

ValueDescription
trueInstall the module
falseDo not install the module

installLinuxIL2CPPModule

Install the Linux IL2CPP build module.

YAMLClassic EditorRequiredDefault
installLinuxIL2CPPModuleLinux IL2CPP Build SupportNofalse

Options:

ValueDescription
trueInstall the module
falseDo not install the module

installMacMonoModule

Install the macOS build module.

YAMLClassic EditorRequiredDefault
installMacMonoModulemacOS Build SupportNofalse

Options:

ValueDescription
trueInstall the module
falseDo not install the module

installMacIL2CPPModule

Install the macOS IL2CPP build module.

YAMLClassic EditorRequiredDefault
installMacIL2CPPModulemacOS IL2CPP Build SupportNofalse

Options:

ValueDescription
trueInstall the module
falseDo not install the module

installWindowsIL2CPPModule

Install the Windows IL2CPP build module.

YAMLClassic EditorRequiredDefault
installWindowsIL2CPPModuleWindows IL2CPP Build SupportNofalse

Options:

ValueDescription
trueInstall the module
falseDo not install the module

installUWPModule

Install the UWP build module.

YAMLClassic EditorRequiredDefault
installUWPModuleUWP Build SupportNofalse

Options:

ValueDescription
trueInstall the module
falseDo not install the module

installWebGLModule

Install the WebGL build module.

YAMLClassic EditorRequiredDefault
installWebGLModuleWebGL Build SupportNofalse

Options:

ValueDescription
trueInstall the module
falseDo not install the module

activateLicense

Activates a seat / license on the agent.

YAMLClassic EditorRequiredDefault
activateLicenseActivate licenseNofalse

Options:

ValueDescription
trueActivate seat / license
falseDo not activate seat / license

username

The username to use for seat activation. This is your Unity ID email.

YAMLClassic EditorRequiredDefault
usernameUsernameYes, if activateLicense is true-

password

The password to use for seat activation. This is your Unity ID password.

YAMLClassic EditorRequiredDefault
passwordPasswordYes, if activateLicense is true-

serial

The serial to use for seat activation. This is the serial for your seat. Obtain it from the Unity dashboard.

YAMLClassic EditorRequiredDefault
serialSerialYes, if activateLicense is true-

deactivateSeatOnComplete

Dectivates a seat / license on the agent once the pipeline has completed.

YAMLClassic EditorRequiredDefault
deactivateSeatOnCompleteDeactivate license when pipeline has finishedNotrue

Options:

ValueDescription
trueDeactivate seat / license
falseDo not deactivate seat / license