UnityEditorArguments Class

Summary

Command-line arguments accepted by Unity Editor.
Assembly
Cake.Unity.dll
Namespace
Cake.Unity
Base Types
  • Object
graph BT Type-->Base0["Object"] Type["UnityEditorArguments"] class Type type-node

Syntax

public class UnityEditorArguments

Constructors

Name Summary
UnityEditorArguments()

Properties

Name Value Summary
AcceptAPIUpdate bool
Use this command line option to specify that APIUpdater should run when Unity is launched in batch mode. Omitting this command line argument when launching Unity in batch mode results in APIUpdater not running which can lead to compiler errors. Note that in versions prior to 2017.2 there’s no way to not run APIUpdater when Unity is launched in batch mode.
AssetServerUpdate AssetServerUpdate
Force an update of the project in the Asset Server given by IP:port. The port is optional, and if not given it is assumed to be the standard one (10733). It is advisable to use this command in conjunction with the -projectPath argument to ensure you are working with the correct project. If you don’t give a project name, then the command line uses the last project opened by Unity. If no project exists at the path -projectPath gives, then the command line creates one automatically.
BatchMode bool

Run Unity in batch mode. You should always use this in conjunction with the other command line arguments, because it ensures no pop-up windows appear and eliminates the need for any human intervention. When an exception occurs during execution of the script code, the Asset server updates fail, or other operations fail, Unity immediately exits with return code 1.

Note that in batch mode, Unity sends a minimal version of its log output to the console. However, the Log Files still contain the full log information. You cannot open a project in batch mode while the Editor has the same project open; only a single instance of Unity can run at a time.

Tip: To check whether you are running the Editor or Standalone Player in batch mode, use the Application.isBatchMode operator.

BuildLinux32Player FilePath
Build a 32-bit standalone Linux player (for example, -buildLinux32Player path/to/your/build).
BuildLinux64Player FilePath
Build a 64-bit standalone Linux player (for example, -buildLinux64Player path/to/your/build)
BuildLinuxUniversalPlayer FilePath
Build a combined 32-bit and 64-bit standalone Linux player (for example, -buildLinuxUniversalPlayer path/to/your/build)
BuildOSX64Player FilePath
Build a 64-bit standalone Mac OSX player (for example, -buildOSX64Player path/to/your/build.app)
BuildOSXPlayer FilePath
Build a 32-bit standalone Mac OSX player (for example, -buildOSXPlayer path/to/your/build.app)
BuildOSXUniversalPlayer FilePath
Build a combined 32-bit and 64-bit standalone Mac OSX player (for example, -buildOSXUniversalPlayer path/to/your/build.app)
BuildTarget Nullable<BuildTarget>
Allows the selection of an active build target before loading a project.
BuildWindows64Player FilePath
Build a 64-bit standalone Windows player (for example, -buildWindows64Player path/to/your/build.exe)
BuildWindowsPlayer FilePath
Build a 32-bit standalone Windows player (for example, -buildWindowsPlayer path/to/your/build.exe).
CacheServerIPAddress string
Connect to the specified Cache Server on startup, overriding any configuration stored in the Editor Preferences. Set string as host:port
CreateProject FilePath
Create an empty project at the given path.
Custom dynamic

Custom arguments which can further be processed in Unity Editor script by calling System.Environment.GetCommandLineArgs method.

They are supplied among other arguments in format "--key=value".

Expected to be used in conjunction with ExecuteMethod argument.

DisableAssemblyUpdater string[]
Specify a space-separated list of assembly names as parameters for Unity to ignore on automatic updates. Pass empty array to ignore all assemblies.
EditorTestsCategories string
Filter editor tests by categories. Separate test categories with a comma.
EditorTestsFilter string
Filter editor tests by names. Separate test names with a comma.
ExecuteMethod string
Execute the static method as soon as Unity opens the project, and after the optional Asset server update is complete. You can use this to do tasks such as continous integration, performing Unit Tests, making builds or preparing data. To return an error from the command line process, either throw an exception which causes Unity to exit with return code 1, or call EditorApplication.Exit with a non-zero return code. To pass parameters, add them to the command line and retrieve them inside the function using System.Environment.GetCommandLineArgs. To use -executeMethod, you need to place the enclosing script in an Editor folder. The method you execute must be defined as static.
ExportPackage ExportPackage
Export a package, given a path (or set of given paths). Asset paths are set relative to the Unity project root. Currently, this option only exports whole folders at a time. You normally need to use this command with the -projectPath argument.
ForceClamped bool
Used with -force-glcoreXY to prevent checking for additional OpenGL extensions, allowing it to run between platforms with the same code paths.
ForceD3D11 bool
Windows only. Make the Editor use Direct3D 11 for rendering. Normally the graphics API depends on Player settings(typically defaults to D3D11).
ForceDeviceIndex bool
MacOS only. When using Metal, make the Editor use a particular GPU device by passing it the index of that GPU.
ForceFree bool
Make the Editor run as if there is a free Unity license on the machine, even if a Unity Pro license is installed.
ForceGfxMetal bool
MacOS only. Make the Editor use Metal as the default graphics API.
ForceGLCore Nullable<ForceGLCore>
Make the Editor use OpenGL core profile for rendering.
ForceGLES Nullable<ForceGLES>
Windows only. Make the Editor use OpenGL for Embedded Systems for rendering.
ForceLowPowerDevice bool
MacOS only. When using Metal, make the Editor use a low power device.
ImportPackage FilePath
Import the given package. No import dialog is shown.
LogFile FilePath
Specify where the Editor or Windows/Linux/OSX standalone log file are written. If the path is ommitted, OSX and Linux will write output to the console. Windows uses the path %LOCALAPPDATA%\Unity\Editor\Editor.log as a default.
NoGraphics bool
When running in batch mode, do not initialize the graphics device at all. This makes it possible to run your automated workflows on machines that don’t even have a GPU (automated workflows only work when you have a window in focus, otherwise you can’t send simulated input commands). Note that -nographics does not allow you to bake GI, because Enlighten requires GPU acceleration.
NoUPM bool
Disables the Unity Package Manager.
Password string
Enter a password into the log-in form during activation of the Unity Editor.
ProjectPath DirectoryPath
Open the project at the given path.
Quit bool
Quit the Unity Editor after other commands have finished executing. Note that this can cause error messages to be hidden (however, they still appear in the Editor.log file).
ReturnLicense bool
Return the currently active license to the license server. Please allow a few seconds before the license file is removed, because Unity needs to communicate with the license server.
RunTests bool
Run all your test by your TestPlatform;
Serial string
Activate Unity with the specified serial key. It is good practice to pass the -batchmode and -quit arguments as well, in order to quit Unity when done, if using this for automated activation of Unity. Please allow a few seconds before the license file is created, because Unity needs to communicate with the license server. Make sure that license file folder exists, and has appropriate permissions before running Unity with this argument. If activation fails, see the Editor.log for info.
SetCustomArguments Action<dynamic>

Custom arguments which can further be processed in Unity Editor script by calling System.Environment.GetCommandLineArgs method.

They are supplied among other arguments in format "--key=value".

Expected to be used in conjunction with ExecuteMethod argument.

SetDefaultPlatformTextureFormat Nullable<DefaultPlatformTextureFormat>
Supported only on Android. Sets the default texture compression to the desired format before importing a texture or building the project. This is so you don’t have to import the texture again with the format you want.
SilentCrashes bool
Prevent Unity from displaying the dialog that appears when a Standalone Player crashes. This argument is useful when you want to run the Player in automated builds or tests, where you don’t want a dialog prompt to obstruct automation.
StackTraceLogType Nullable<StackTraceLogType>
Detailed debugging feature. StackTraceLogging allows you to allow detailed logging. (for example, -stackTraceLogType Full)
TestPlatform Nullable<TestPlatform>
Allows the selection of an active test platform.
TestResults FilePath
Path location to place the result file. If the path is a folder, the command line uses a default file name. If not specified, it places the results in the project’s root folder.
Username string
Enter a username into the log-in form during activation of the Unity Editor.

Extension Methods

Name Value Summary
Dump<UnityEditorArguments>() string
Get a basic string representation of specified object.
Requires the Cake.Incubator addin
IsIn<UnityEditorArguments>(UnityEditorArguments[]) bool
Checks if the source is contained in a list
Requires the Cake.Incubator addin
NotNull<UnityEditorArguments>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Issues addin
NotNull<UnityEditorArguments>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Ftp addin
ThrowIfNull<UnityEditorArguments>(string) T
Throws a System.ArgumentNullException if the value is null, otherwise returns the value
Requires the Cake.Incubator addin
ThrowIfNull<UnityEditorArguments>(string, string) T
Throws a System.ArgumentNullException with a specific message if the value is null, otherwise returns the value
Requires the Cake.Incubator addin
ToDictionary() IDictionary<string, object>
Requires the Cake.DeployParams addin