Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Dedicated Server option CLI command in 2021.2+.

Discussion in 'Testing & Automation' started by Flamacore, Jan 21, 2022.

  1. Flamacore

    Flamacore

    Joined:
    Dec 17, 2013
    Posts:
    138
    So here's a question. Now that Headless Mode is out and Dedicated Server build target is in, how do we trigger it from CLI?

    upload_2022-1-21_12-6-1.png
     
  2. Flamacore

    Flamacore

    Joined:
    Dec 17, 2013
    Posts:
    138
    hopeless bump? :D
     
  3. WilderBurn

    WilderBurn

    Joined:
    Aug 19, 2021
    Posts:
    5
    You need to use the BuildPipeline.BuildPlayer API that has the BuildPlayerOptions as its argument.
    Then specify the Server as the subtarget field:

    Code (CSharp):
    1. BuildPlayerOptions buildPlayerOptions = new BuildPlayerOptions()
    2. buildPlayerOptions.subtarget = (int)StandaloneBuildSubtarget.Server;
     
    chi-anykraft and GrassWhooper like this.