- Home /
-batchmode Not Blocking on Command-Line Windows
We are trying to invoke Unity -batchmode on our build server. We're noticing, when ran from the command line, the command returns immediately (though Unity is still running in the background).
Is there a way to run Unity -batchmode such that it blocks while Unity is executing? We're currently using Unity 4.1.5f1
Our command:
"C:\Program Files (x86)\Unity\Editor\Unity.exe" -quit -batchmode -nographics -executeMethod BuildAndRunScript.Build
Thanks in advanced.
Only one instance of unity can be running at a time. I wrote a simple windows application that would build all my asset bundles in multiple projects using System.Diagnostics.Process WaitForExit. If you have multiple people potentially building at the same time, I would suggest specifying the log file(-logFile ) through the command args and write an app that watches the log file until it completes, then executes your command.
Answer by lighting · Jun 11, 2013 at 11:06 PM
We have bat script, which we,re running. Inside batch we have:
"C:\Project\Game.exe" -batchmode -nographics
We run this script by double-click and we have window open still and running.
omg, I've spent 2 hours trying to figure out what is wrong with it
Answer by juanpablo_unity · Nov 09, 2018 at 04:01 PM
A possible way for handling it is using start command waiting for the termination of Unity process:
start /b /wait "dummy" "C:\Program Files\2018.2.14f1\Editor\Unity.exe" -projectPath C:\Projects\UnityBatchmodeWin -batchmode -quit
Side note: I should use a "dummy" calling because a known bug of the start command; if you have spaces in both, the command or the parameters and try to handle them with quotes, it fails!
Your answer
Follow this Question
Related Questions
Batchmode and animation 1 Answer
Building Asset Bundles requires Unity Advanced for WebPlayer 1 Answer
Test Runner timed out using batchmode in 2018.3.2f1 1 Answer
building scenes on a vm 2 Answers
Take screenshot in batchmode 0 Answers