You can launch Unity Players from the command line and pass in arguments to change how the Player executes.
Command | Details: |
---|---|
-batchmode |
Run the application in “headless” mode. In this mode, the application doesn’t display anything or accept user input. This is useful for running servers for networked applications. |
-disable-gpu-skinning |
Disables Graphics Processing Unit (GPU) skinningThe process of binding bone joints to the vertices of a character’s mesh or ‘skin’. Performed with an external tool, such as Blender or Autodesk Maya. More info See in Glossary at startup. |
-force-clamped |
Use this together with -force-glcoreXY to prevent checks for additional OpenGL extensions, allowing the application to run between platforms with the same code paths. |
-force-d3d11-singlethreaded |
Force DirectX 11.0 to be created with a D3D11_CREATE_DEVICE_SINGLETHREADED flag. |
-force-device-index |
Make the Standalone Player use a specific GPU device by passing it the index of that GPU. This option is supported for D3D11, D3D12, Metal, and Vulkan graphics APIs, but isn’t supported for OpenGL. |
-force-glcore |
Force the application to use the OpenGL core profile for rendering. The Editor tries to use the most recent OpenGL version available, and all OpenGL extensions exposed by the OpenGL drivers. Unity uses Direct3D if the platform doesn’t support OpenGL. |
-force-glcoreXY |
Similar to -force-glcore , but requests a specific OpenGL context version. Accepted values for XY: 32, 33, 40, 41, 42, 43, 44, or 45. |
-force-vulkan |
Force the application to use Vulkan for rendering. |
-force-wayland (Linux only) |
Activate experimental Wayland support when running a Linux player. |
-monitor N |
Run Standalone Player on the specified monitor, indicated by a 1-based index number. |
-nographics |
When you use this argument in batch mode, Unity doesn’t initialize a graphics device. This makes it possible to run your automated workflows on machines that don’t have a GPU. |
-nolog |
Do not produce an output log. When you don’t use this argument, Unity writes the output_log.txt in the Log Files folder, where the Debug.Log output is printed. |
-no-stereo-rendering |
Turn off stereo rendering. |
-popupwindow |
Create the window as a pop-up window, without a frame. This command isn’t supported on macOS. |
-screen-fullscreen |
Override the default full-screen state. This must be 0 or 1. |
-screen-height |
Override the default screen height. This must be an integer from a supported resolution. |
-screen-width |
Override the default screen width. This width value must be an integer from a supported resolution. |
-screen-quality |
Override the default screen quality. Example usage would be: /path/to/myGame -screen-quality Beautiful . The supported options match the Quality Settings names. |
-vrmode <devicetype> |
Launch with a specific VR device. For more information, see Virtual RealityA system that immerses users in an artificial 3D world of realistic images and sounds, using a headset and motion tracking. More info See in Glossary. |
-force-low-power-device (macOS only) |
Make the Standalone Player use a low power device. |
-force-metal (macOS only) |
Make the Standalone Player use Metal as the default graphics API. |
-force-d3d11 (Windows only) |
Force the application to use Direct3D 11 for rendering. |
-force-d3d12 (Windows only) |
Force the application to use Direct3D 12 for rendering. |
--parentHWND <HWND> delayed (Windows only) |
Embed the Windows Standalone application into another application. When you use this argument, you need to pass the parent application’s window handle (‘HWND’) to the Windows Standalone application. When you pass -parentHWND 'HWND' delayed , the Unity application is hidden while it runs. You must also call SetParent from the Microsoft Developer library for Unity in the application. Microsoft’s SetParent embeds the Unity window. When it creates Unity processes, the Unity window respects the position and size provided as part of Microsoft’s STARTUPINFO structure.To resize the Unity window, check its GWLP_USERDATA in Microsoft’s GetWindowLongPtr function. Its lowest bit is set to 1 when the graphics initialize and it’s safe to resize. Its second lowest bit is set to 1 after the Unity splash screen finishes displaying.For more information, see this downloadable example: EmbeddedWindow.zip |
-single-instance (Linux and Windows only) |
Run only one instance of the application at the time. If another instance is already running then launching the application again with -single-instance focuses the existing one. |
-window-mode (Windows only) |
Override fullscreen windowed mode. Accepted values are exclusive or borderless . For more information, see Standalone Player settings. |
Universal Windows Apps don’t accept command line arguments by default, so to pass them you need to call a special function from MainPage.xaml.cs/cpp or MainPage.cs/cpp. For example:
appCallbacks.AddCommandLineArg("-nolog");
You should call this before the appCallbacks.Initialize()
function.
Command | Details: |
---|---|
-force-d3d11-singlethreaded |
Force DirectX 11.0 to be created with a D3D11_CREATE_DEVICE_SINGLETHREADED flag. |
-force-driver-type-warp |
Force the DirectX 11.0 driver type WARP device. For more information, see Microsoft’s documentation on Windows Advanced Rasterization Platform. |
-force-feature-level-9-3 |
Force DirectX 11.0 feature level 9.3. |
-force-feature-level-10-0 |
Force DirectX 11.0 feature level 10.0. |
-force-feature-level-10-1 |
Force DirectX 11.0 feature level 10.1. |
-force-feature-level-11-0 |
Force DirectX 11.0 feature level 11.0. |
-force-gfx-direct |
Force single threaded rendering. |
-nolog |
Don’t produce UnityPlayer.log. |
When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer.
More information
These cookies enable the website to provide enhanced functionality and personalisation. They may be set by us or by third party providers whose services we have added to our pages. If you do not allow these cookies then some or all of these services may not function properly.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us to know which pages are the most and least popular and see how visitors move around the site. All information these cookies collect is aggregated and therefore anonymous. If you do not allow these cookies we will not know when you have visited our site, and will not be able to monitor its performance.
These cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. They do not store directly personal information, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less targeted advertising. Some 3rd party video providers do not allow video views without targeting cookies. If you are experiencing difficulty viewing a video, you will need to set your cookie preferences for targeting to yes if you wish to view videos from these providers. Unity does not control this.
These cookies are necessary for the website to function and cannot be switched off in our systems. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms. You can set your browser to block or alert you about these cookies, but some parts of the site will not then work. These cookies do not store any personally identifiable information.