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?

Try setting -projectPath to the full path of your project and not just “.”. It works for me when I set the full path.

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

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