-quit -batchmode -executeMethod YourEditorScript.YourBuildMethod [-nographic]
or
-quit -batchmode -buildWindowsPlayer path/to/your/build.exe
or
-quit -batchmode -buildOSXPlayer path/to/your/build.app
Note: we make little to no attempt to detect conflicting arguments or arguments not suitable to the platform neither at configuration nor at runtime.
If the specified command line contains no -projectpath
argument, the plugin automatically adds one with the proper parameter (the workspace of the project on the target machine).
This is to make sure unity builds the proper project. Otherwise unity would reuse the last opened project. You can override it, but this hasn't been thoroughly tested.
See the official Editor command line arguments documentation.