Skip to main content

About the Unity CMD Task

This task is a general use command line task. It does not do anything in particular, unless you tell it to. It will invoke the Unity command line using arguments you provided. Use this task whenever any of the other tasks does not fulfill your needs.

Syntax

# Unity CMD Task V1
# Invokes the Unity command line providing a custom command line argument
- task: UnityCMDTask@1
inputs:
cmdArgs: -myCustomArgument

Inputs

unityEditorsPathMode

For the task to run successfully it needs to know where Unity installations are located at on the agent. This input lets you configure, where the task should look for installations.

YAMLClassic EditorRequiredDefault
unityEditorsPathModeUnity editors locationYesdefault

Options:

ValueDescription
defaultUses the Unity Hub default installation path
environmentVariableExpects an environment variable UNITYHUB_EDITORS_FOLDER_LOCATION to exist on the agent and specifying where to find editor installations.
specifyLet's you specify a custom path where to lookup editor installations using the input customUnityEditorsPath

customUnityEditorsPath

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

YAMLClassic EditorRequiredDefault
customUnityEditorsPathEditors folder locationYes, if unityEditorsPathMode 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

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-

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-

cmdArgs

Specify command line arguments to pass to the Unity process when running the task.

YAMLClassic EditorRequiredDefault
cmdArgsCommand line argumentsYes-

Output variables

This task defines the following output variables, which you can consume in downstream steps, jobs, and stages.

editorLogFilePath

Path to the Unity editor log file generated while executing the task.