Search Unity

Headless Unity Hub CLI Won't Run Without GUI

Discussion in 'Unity Hub' started by timvanazon, Jul 20, 2021.

  1. timvanazon

    timvanazon

    Joined:
    Jan 16, 2020
    Posts:
    2
    Hi,

    I'm trying to set up a build pipeline that uses an EC2 Mac instance (Big Sur) to run Unity. I wanted to use Unity Hub (2.4.4) to install the Unity Editor automatically. Unfortunately, running

    /Applications/Unity\ Hub.app/Contents/MacOS/Unity\ Hub -- --headless help


    just hangs, and no log is produced. I noticed that when I use Apple Remote Desktop to log into the instance even once, I can then run Unity Hub from the command line just fine, even after disconnecting from Remote Desktop.

    It seems that Unity Hub still needs a graphical environment, at least on first run. Is there any solution or workaround for this?
     
  2. unity_Q6gtYM13wT7GjQ

    unity_Q6gtYM13wT7GjQ

    Joined:
    Oct 1, 2021
    Posts:
    3
    This might help: https://docs.unity3d.com/Manual/desktop-headless-mode.html

    Desktop Headless Mode

    The Dedicated Server build target is similar to the Desktop Headless Mode. The only difference is that the Dedicated Server build target is optimized to increase memory and CPU performance when running as a networked application.

    Desktop Headless Mode allows you to run applications in batchmode on any desktop platform without initializing the graphics device. You can run Desktop Headless Mode by passing the -batchmode and -nographics command line arguments when executing the Player. You can’t select Headless Mode from the Unity Editor Build Settings, but you can add the -batchmode and -nographics command line arguments to effectively create a headless build.

    Desktop Headless Mode doesn’t perform any optimizations for running a build as a dedicated server. Although the Dedicated Server build option performs additional optimizations, you might still want to use Desktop Headless Mode for other purposes, such as automated testing on CI/CD platforms.