- Home /
Build command line doesn't work
On MacOS I'd like to build the web player from a script. I tried with the following command (executed from my project's directory):
/Applications/Unity/Unity.app/Contents/MacOS/Unity -batchmode -projectPath . -buildWebPlayer ./web -quit
But nothing happens: the command terminates with no output and my web folder is still empty.
Any idea?
Answer by Henrik Poulsen · Mar 14, 2015 at 07:12 PM
Try setting -projectPath to the full path of your project and not just ".". It works for me when I set the full path.
Answer by Carocrazy132 · Feb 15, 2020 at 12:09 AM
I have the same experience, this utility doesn't seem to work for me at all.
I'm currently working with
"C:\Program Files\Unity\Hub\Editor\2018.2.15f1\Editor\Unity.exe" -batchmode -nographics -logFile "C:/buildlog.txt" -projectPath "C:\Users\myusername\Documents\GitHub\projectpath" -executeMethod MyBuildPipeline.BuildCMD()
with no luck, no matter what I do unity runs for a second and then silent crashes
Answer by lone09 · Feb 16, 2020 at 10:39 AM
This is showing the flags, and script functionality, needed to run an automated build on OSX. Hope this helps! Did you look at this line: Mac OS: /Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -batchmode -executeMethod MyEditorScript.MyMethod
https://docs.unity3d.com/Documentation/Manual/CommandLineArguments.html