Unity Editor command line arguments reference
A list of arguments you can use when you launch a version of the Unity Editor from the command line.
Read time 27 minutesLast updated 3 days ago
You can launch the Unity Editor and Player with additional command line arguments to control startup behavior, configure settings, or automate workflows.
To use these arguments, append them to the Unity executable path when launching from a terminal or command prompt. For example: .
unity.exe -batchmode -quit -executeMethod MyClass.MyMethodFor more information, refer to Run Unity from a command-line interface.
- Asset import arguments
- Configuration arguments
- Batch mode arguments
- Package Manager arguments
- Build arguments
- Unity Accelerator cache server arguments
- Debugging arguments
- Graphics API arguments
- License arguments
- Metal arguments (macOS only)
- Profiler arguments
- Unity Editor special command line arguments
- Unity Hub special command line arguments
Asset import arguments
Use these arguments to override the Asset Pipeline settings for a single Editor session.
Command | Description |
|---|---|
| Sets how the Editor uses parallel processes to import assets during an Asset Database refresh, and overrides the Parallel Import setting. Choose from the following values:
|
| Sets the number of import worker processes that the import pipeline treats as optimal, and overrides the Desired Import Worker Count setting. |
| Sets the minimum number of import worker processes to keep available, even when they're idle, and overrides the Standby Import Worker Count setting. The default value is |
| Sets how long an import worker process can stay idle before Unity shuts it down, and overrides the Idle Import Worker Shutdown Delay setting. Unity doesn't shut down a worker if doing so takes the number of workers below the standby worker count. The default value is Note: This argument takes a value in milliseconds, but the Idle Import Worker Shutdown Delay property takes a value in seconds. |
Configuration arguments
You can run the Unity Editor and build Unity applications with additional commands and information on startup. This page lists the command line arguments you can use to launch and configure Unity Editor and Unity Player instances.
Command | Description |
|---|---|
| Create an empty project at the given path. |
| Use Example (Windows): Example (macOS): Example (Linux): |
| Performs an importer consistency check on Editor startup. By default Unity performs a Note: Consistency checking mode disables uploads to Unity Accelerator and is intended to be used to test that importer output is deterministic. For more information, refer to the description for |
| Sets the source to check against when Unity compares the asset imports. Choose from the following values:
|
| Enable shader cache consistency checking. For more information, refer to Shader variant compilation caching. |
| Enable texture compression output cache consistency checking. For more information, refer to Texture compression caching. |
| Specify a space-separated list of assembly names as parameters for Unity to ignore on automatic updates. The space-separated list of assembly names is optional: pass the command line options without any assembly names to ignore all assemblies, as in example 1. Example 1 Example 2 Example 2 has two assembly names, one with a pathname. Example 2 ignores If you list an assembly in the Use this to avoid unnecessary API Updater overhead when you import assemblies. This argument is useful if you want to import assemblies that access a Unity API which doesn't need updating. It's also useful when you import assemblies that don't access any Unity APIs (for example, if you have built some or all your source code outside of Unity, and you want to import the resulting assemblies into your Unity project). Notes:
|
| Disable Graphics Processing Unit (GPU) skinning at startup. |
| Disable specified playback engines (build modules). This argument is useful for preventing Unity from generating platform-specific metadata for untargeted platforms, removing the need to uninstall build modules for the same outcome. This argument doesn't have a limit to the number of passed parameters. Parameters must match the name of the build module's install directory and are case-sensitive. Example |
| Execute the static method as soon as Unity opens the project, and after the optional Asset server update is complete. You can use this for tasks such as continuous integration, performing Unit Tests, making builds or preparing data. If To return an error from the command line process, either throw an exception which causes Unity to exit with return code 1, or call To pass parameters, add them to the command line and retrieve them inside the function using |
| Specify the maximum thread count for the Unity JobQueue Job Worker Count. |
| Specify the number of asset garbage collector helper threads. The default value is the number of cores available. |
| Specifies a file path location to which Unity writes the Editor log file. For more information on the default location of the log file, refer to Log files reference. To output to the console, specify Example (Windows): Example (macOS): Example (Linux): To specify the location of the log file for the UPM background application, refer to the description for |
| Disables the Unity Package Manager. |
| Open the project from a path to a scene or package file. Alternatively, you can use the |
| Enter a password into the log-in form during the activation of the Unity Editor. |
| Open the project at the given path, which can be absolute or relative to the current working directory. If the pathname contains spaces, enclose it in quotes. |
| Quit the Unity Editor after other commands have finished executing. This can hide some error messages, but they still appear in the Editor's log file. The
|
| When you use the |
| Enables release code optimization mode, overriding the current default code optimization mode for the session. |
| Set the default texture compression to the desired format before you import a texture or build the project. This is so you don't have to import the texture again with the format you want. The available formats are dxt, atc, etc, etc2, and astc. This argument is ignored when texture compression targeting is enabled. |
| Overrides the maximum texture size (in pixels) that Unity applies when importing assets. This setting affects all textures in your project, and overrides any Max Size configured for individual textures in the texture import settings. The value is an integer that represents a maximum limit on either the height or width of the texture, whichever is longer. Aspect ratio is always maintained when resizing. For example, if a texture is 2048×1024 pixels but |
| Overrides the texture compression settings that Unity uses when it imports assets. This is particularly useful during local development, to speed up texture importing or build target switching. For details, refer to EditorUserBuildSettings.overrideTextureCompression. |
| 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. |
| Override the default Package Manager log file path. By default, the Package Manager background application writes logs to |
| Use one global |
| Enter the email address associated with the Unity ID you use to log in to Unity products and services. For more information on using this option when activating a Unity license through the command line, refer to Manage your license through the command line. For more information on using this option when exporting and signing a UPM package you created, refer to Sign a UPM package using command line arguments. |
| Set the version control mode. Available modes are Note: |
| Set the version control mode for this session. Available modes are Note: |
| Print the version number of the Unity Editor in the command line, without launching the Editor. |
| Prefixes every Editor.log message with the current timestamp and thread ID. |
Batch mode arguments
Use the following arguments to configure Unity's batch mode. Batch mode enables Unity to run predefined tasks without user input, which makes batch mode useful for automated tasks like testing.
Command | Description |
|---|---|
| Use this command line option to run API Updater when Unity is launched in batch mode. Example: The API Updater doesn't run if you omit this command line argument when you launch Unity in batch mode. This might lead to compiler errors. |
| Run Unity in batch mode. In batch mode, Unity runs command line arguments without the need for human interaction. It also suppresses dialog windows that require human interaction (such as the Save Scene window). Always run Unity in batch mode when using command line arguments, because it allows automation to run without interruption. 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. 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 can't 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. To check whether the Editor or Standalone Player is running in batch mode, use the Application.isBatchMode operator. If the project hasn't yet been imported when using |
| When you use this argument, Unity continues to start your application even if there are compilation errors. |
| When you run this in batch mode, Unity doesn't initialize the graphics device. You can then run automated workflows on machines that don't have a GPU. Automated workflows only work when you have a window in focus, otherwise you can't send simulated input commands. Note: Output logs are turned off in this mode. To enable the creation of output logs, specify a file location using the command |
Package Manager arguments
Use the following arguments to manage packages from the command line.
Command | Description |
|---|---|
| Export whole folders as an asset package (Parameters Mandatory. One or more folders (relative to the root of the Unity project) that contain the assets to export. Specify multiple folders as space-delimited list. Mandatory. The file name of the output package. By default, the command places the output file in the root of your project directory. Optional. Produces an asset package that contains a package signature. If you supply this parameter, the CLI signs the package only if you're connected to the internet and your credentials are successfully authenticated. Otherwise, the command completes but produces an unsigned package. Notes: - To sign an asset package using the - Get your organization ID from the Unity Cloud Dashboard. For information about copying your organization ID, refer to Identify the organization ID. Example 1 Export assets from one folder as an unsigned asset package: Example 2 Export assets from two folders as a signed asset package: |
| Import the given asset package. Unity doesn't display any import dialog. Note: You can't use the |
| Use this command in batch mode to export and sign a UPM package you created. Upon successful completion, the command creates a tarball file at the specified location. The following example shows the mandatory parameters for this command:For more information, refer to Pack and sign a UPM package using Editor command line arguments. Note: When you use the |
Build arguments
Use the following arguments to build Players for various platforms from the command line. For more information about building Players from the command line, refer to Create a build from the command line.
Command | Description |
|---|---|
| Set the build profile saved at the given path as an active build profile (for example, Notes:
|
| Build a Player from |
| Build a 64-bit standalone Linux player (for example, |
| Build a 64-bit Linux headless simulation player (for example, |
| Build a 64-bit standalone macOS player (for example, |
| Select an active build target to launch the Editor in. The options available depend on which build targets you have enabled in the Editor. These options correspond to the options available in API enumeration
|
| Build a 32-bit standalone Windows player (for example, |
| Build a 64-bit standalone Windows player (for example, |
| Select an active build subtarget for the Standalone platforms before loading a project:
|
Unity Accelerator cache server arguments
Use the following arguments to configure Unity's use of the Unity Accelerator cache server. These arguments override any corresponding configuration stored in the Editor Preferences.
Command | Description |
|---|---|
| Enable Unity Accelerator. You must also use |
| Enable caching of import results in the Unity Accelerator. Import result caching is disabled by default from Unity 6.5 in new projects. |
| Specifies the endpoint address of the Unity Accelerator instance. Example: The default port is |
| Set the namespace prefix for the Unity Accelerator instance. Use this argument with a namespace name to partition data on the cache server, for example to isolate cache data for different projects or Unity versions. Example: A prefix that contains spaces must be wrapped in double quotes ( The supplied name is used as the prefix for up to 3 namespaces in the cache which separate data by type - metadata, artifact data and shader cache data. |
| Enable or disable downloading from the Unity Accelerator instance. |
| Enable or disable uploading to the Unity Accelerator instance. Example: |
| Specify the time in milliseconds that Unity will wait for a connection to the Unity Accelerator instance while loading a project, before starting the initial project refresh. Example: |
| Set the number of artifacts in individual cache server download batches. Download batches are an optimization used to reduce the number of download operations by grouping individual downloads into larger batches. Example: Default value is |
| Upload any existing imports that haven't been previously uploaded when Unity begins to upload new imports to the Unity Accelerator instance. Imports that have been previously uploaded aren't re-uploaded. |
| Upload any existing imports including all previous revisions known to the Asset Database that haven't previously been uploaded when Unity begins to upload new imports to the Unity Accelerator instance. Import revisions that have been previously uploaded, aren't re-uploaded. |
| Upload any existing shader cache imports that haven't previously been uploaded when Unity begins to upload new imports to the cache server. Shader imports that have been previously uploaded, aren't re-uploaded. |
| Disable shader caching. Use |
| Disable texture compression output caching. Use |
Debugging arguments
Command | Description |
|---|---|
| Disables the debugger listen socket. |
| Unity launches only one instance of the Shader Compiler, and forces its timeout to be one hour. Useful for debugging Shader Compiler issues. |
| Enables debug code optimization mode, overriding the current default code optimization mode for the session. |
| Enables code coverage and allows access to the Coverage API. |
| Enables the DX12 validation layer. This is useful for working on XR plug-ins or native plug-ins. |
| Enables the DX12 GPU-based validation. This is useful for working on XR plug-ins or native plug-ins. |
| Enables the DX12 GPU crash dump generation by NVIDIA Aftermath. For more information, refer to NVIDIA Nsight Aftermath. |
| Enables the Vulkan validation layer. This is useful for working on XR plug-ins or native plug-ins. |
| Allow detailed debugging. All settings allow None, Script Only and Full to be selected (for example, |
| Adds detailed memory and performance reports to the main Unity Editor log file when closing the editor. |
| Makes the Editor wait for a managed debugger to attach before launching. Generates a dialog that displays the Editor's process ID. For more information on managed debugging, refer to Debug C# code in Unity. |
| Makes the Editor wait for a native debugger to attach before launching. Generates a dialog that displays the Editor's process ID. |
Graphics API arguments
Use the following arguments to force the Unity Editor to use a specific graphics API.
Command | Description |
|---|---|
| Use this with |
| Make the Editor use Direct3D 11 for rendering. Normally the graphics API depends on Player Settings (typically defaults to D3D11). |
| Make the Editor use Direct3D 12 for rendering. Normally the graphics API depends on Player Settings. |
| Make the Editor use a particular GPU device by passing it the index of that GPU. For example, use this to force the Editor to use the integrated GPU instead of the dedicated one. Mapping between GPU indices and physical GPUs is determined by the order in which the GPUs are enumerated by your system. This enumeration is typically done by the GPU driver or the underlying framework being used (for example Metal, Direct3D or Vulkan). Normally, index |
| Make the Editor use OpenGL 3/4 core profile for rendering. The Editor tries to use the best OpenGL version available and all OpenGL extensions exposed by the OpenGL drivers. If the platform isn't supported, the editor uses Direct3D. |
| Similar to |
| Make the Editor use OpenGL for Embedded Systems for rendering. The Editor tries to use the best OpenGL ES version available, and all OpenGL ES extensions exposed by the OpenGL drivers. |
| Similar to |
| Make the Editor use the legacy OpenGL back end. |
| Make the Editor use Vulkan for rendering. Normally the graphics API depends on Player Settings. |
License arguments
Use the following arguments to process a Unity license or run the Unity Editor with different license options.
Command | Description |
|---|---|
| Step one of a three-step process to manually activate a Unity license. For more information, refer to Manual license activation. |
| Step three of a three-step process to manually activate a Unity license. The license file is a |
| Return the currently active serial-based or named user license. Don't use |
| Activate your paid Unity license. Include the Note: When you use the |
Metal arguments (macOS only)
Use the following arguments to configure Unity's use of the Metal graphics API for Apple devices.
Command | Details: |
|---|---|
| If you use Metal, make the Editor use a low power device. |
| Make the Editor use Metal as the default graphics API (macOS only). |
| Enable the ability to take Metal captures from inside the Editor. |
Profiler arguments
Use the following arguments to configure Unity's use of the Profiler.
Command | Description |
|---|---|
| Enable Deep Profiling option for the CPU profiler. |
| Profile the start-up of a Player or the Editor. When you use this argument with a Player, it has the same effect as building the Player with the Autoconnect Profiler option enabled in Build Profiles. When you use this argument with the Editor, it starts collecting and displaying Profiler information in the Profiler window on start-up of the Editor. |
| This argument sets up the Unity Profiler to stream the profile data to a .raw file on startup. It works for both Players and the Editor. |
| This argument sets how many frames the Profiler should capture in a profile when streaming to a .raw file on start-up. It only works on Players. |
| By default, |
Unity Editor special command line arguments
Only use these under special circumstances, or when directed by Unity Support.
Command | Description |
|---|---|
| Use this when you have Assets made by a newer, incompatible version of Unity, that you want to downgrade to work with your current version of Unity. When you enable this, Unity presents you with a dialog asking for confirmation of this downgrade if you attempt to open a project that would require it. Note: This procedure is unsupported and highly risky, and should only be used as a last resort. |
| Sets a custom location for the Global Illumination (GI) cache folder. The value must be an absolute path, which must be enclosed in quotes if it contains any spaces. If |
| This procedure deletes the |
Unity Hub special command line arguments
Only use these under special circumstances, or when directed by Unity Support. These arguments are used in versions of the Unity Editor that don't use the Unity Hub by default.
Command | Description |
|---|---|
| Launch the Unity Editor with Hub integration. |
| Enable communication and interaction between the Unity Editor and the Unity Hub. |
| Specify a unique identifier for a Unity Hub session. |
In all supported versions of the Unity Editor, these arguments are already set by default.
Additional resources
- Create a build from the command line
- Android Player command-line arguments
- Use Unity Accelerator on the command line
- Build for Embedded Linux from the command line
- Build for QNX from the command line
- Test Framework command-line arguments reference
- Profiler command-line arguments reference
- Run Project Auditor from the command line