#More recent docs have the option
1 messages · Page 1 of 1 (latest)
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 😦
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?
@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.
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.
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
Otherwise, it won't work.
serial number? for what? Who is checking that number?
Unity is lol.
But I use PlayFlow and upload my server already there and all works without a problem?
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.
Ah... you use Unity Cloud Services ?
Nope! 😄
We made the docker container ourself, installed Win10 SDK and launch unity all inside the container.
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
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 😄
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
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.
The problem I have is that I don't understand the nuances and differences of these arguments. What is a subTarget for example?
It's not stopping
More likely it's waiting on something?
That's the result and it is executable - however it's not a dedicated server build
Well ok you're right. The command line does not "exit" - however there is a working output nethertheless?
may need to add -quit at the end of your argument?
checking that
Ok that at least made the command line quit properly
Thanks for that @quiet matrix
Also - I'm still digging, it's weird that Unity doesn't have a commandline argument for server build only...
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
Anything in the logfile?
No error that kinda points to that so far as I can understand
Interesting... Are you using your computer to run this command line argument?