#More recent docs have the option

1 messages · Page 1 of 1 (latest)

neat lantern
#

Sorry but I am still having a hard time understanding how this all works.
It seems as soon as I start the command line execution Unity still starts the Editor. However I just want to it build the dedicated server for Linux.

Also the documentation is quite misleading for a beginner like me:

-standaloneBuildSubtarget <name>

Select an active build subtarget for the Standalone platforms before loading a project. Possible options are:

• Player
• Server

This argument seems like what I want. However it says it "Selects an active build subtarget for the plaforms before loading a project".
However I don't want to load a project or whatsoever. I simply want to refer to a project and tell the command line to build a dedicated server right away.

This argument only gives me the option of "Player" or "Server" - but nothing about Linux, Windows or Mac server.

I am still rendered confused 😦

quiet matrix
#

However I don't want to load a project or whatsoever. I simply want to refer to a project and tell the command line to build a dedicated server right away.

This seems contradicting. You are telling Unity to build a project to a specific platform. Without loading a project initially, what will unity compiles?

neat lantern
#

@quiet matrix
Sorry I might've understood things wrongly. I went down the rabbithole now and kinda got things to work.

/Applications/Unity/Hub/Editor/2021.3.16f1/Unity.app/Contents/MacOS/Unity buildOSXUniversalPlayer Distribution/server_mac -batchmode -nographics -projectPath . 

Just to make things clear - What I want to achieve is the same like pressing the "Build" button in the Unity Editor when building a dedicated server (see screenshot) but solely by command line usage.

I might be mixing up Player "Start" arguments and arguments to Build a player/standalone player.

That's where I am unsure at the moment what to do proplerly. The above command I posted does "things" but it doesn't seem right. It is starting Unity Editor without visuals it seems but it isn't starting the build process.

quiet matrix
#

use --batchmode to compile without Unity gui.

#

One thing I could think of that could stop you from building is that using the command line argument on a headless server is that you need to have a serial number to register your unity product.

neat lantern
#

Yeah I did that so far.
So the build actually exists. However it's not the same structure and usability like the output I get when using the Editor UI

quiet matrix
#

Otherwise, it won't work.

neat lantern
quiet matrix
#

Unity is lol.

neat lantern
#

But I use PlayFlow and upload my server already there and all works without a problem?

quiet matrix
#

In my past experience, we've tried using docker to build WSA build - and it prevented us from launching unity inside docker without an active seat register. We would then pass a license key to tell Unity service that we are using this license to run command.

neat lantern
#

Ah... you use Unity Cloud Services ?

quiet matrix
#

Nope! 😄

#

We made the docker container ourself, installed Win10 SDK and launch unity all inside the container.

neat lantern
#

hm ok... well let's push that potential issue beside should we? Cause first of all I need a working script before I can put anything into docker

quiet matrix
#

It's rather painful to use win env inside docker - but since you're using macOS, this process is different, but otherwise share the same unity problem - running build on a headless server.

#

Alternatively - you can request the license key from the container, and register to unity, and then activate it all inside a running container environment.

#

It's a painful requirement, but we were able to get this working by sharing the license key file 😄

neat lantern
#

This is what is generated by using Unity Editor manually

#

And this is what I get via my current command line usage

#

the first one is super convenient and starts the server just by opening Bangerang (name of the game)

#

So my goal is to generate that one via Command Line. Just can't find the proper arguments for that

quiet matrix
#

Yeah there's something weird going on. Without GUI to tell you the problem, you'd need to add -logFile <path_to_output> and investigate what's stopping your build.

neat lantern
#

The problem I have is that I don't understand the nuances and differences of these arguments. What is a subTarget for example?

quiet matrix
#

More likely it's waiting on something?

neat lantern
neat lantern
quiet matrix
#

may need to add -quit at the end of your argument?

neat lantern
#

Ok that at least made the command line quit properly

#

Thanks for that @quiet matrix

quiet matrix
#

Also - I'm still digging, it's weird that Unity doesn't have a commandline argument for server build only...

neat lantern
#

yeah well I made it work with using -batchmode however the server seems to be lacking log outputs

#

-standaloneBuildSubtarget Server also used this. Cause I thought it might do the trick. Nothing changed however

quiet matrix
#

Anything in the logfile?

neat lantern
#

No error that kinda points to that so far as I can understand

quiet matrix
#

Interesting... Are you using your computer to run this command line argument?