Why is command line build so complicated?

I am trying to integrate unity build into Jenkins and it is frustrating me to no end.

On Gui, I go into File → Build Settings → Select “Secens in Build” → Click “Build”
On CMD, invoke Unity.exe with -batchmode -projectPath <C:/myProjectPath> -executeMethod -quit

Why do I need to write a script file for cmdline when the gui does everything without a script?
Surely you can just add target flag then point to .unity file

Surely automated building isn’t a new problem and I can’t be the only one to run into this.
Please streamline your build unity.

You dont. -executeMethod is for running any method. a build is just one thing that method could be be doing.

If you want to do a build that doesnt need the specificity of a custom -executeMethod, that’s maybe what -buildPlayer and -buildTarget are for.

Command line has a ton of options because people wanted them. Removing features because one person is finding them too complex is not a valid reason. If you want a streamlined build either use the UI or learn to use the command line as it’s intended.

1 Like

Or, if you’re doing the same thing a bunch, just… use a batch file.

I think OP meant that there are no command-line arguments to specify things like scenes to export etc. and instead has to rely on creating static methods to do what he needs.

4 Likes

That’s what I’d guessed.

For my part though, I would hate trying to do all that via a command line. A C# script feels much easier to deal with.

1 Like