Equivalent of "Build and Run"

Is there a way to make a menu option that does the equivalent of “Build and Run” with Command-B, but just does a build (i.e. the same thing without BuildOptions.AutoRunPlayer specified).

I know how to make my own build script (many of our projects do) and call BuildPipeline.BuildPlayer, but then you end up building your own UI for build platform, output location, debug mode, connect profiler, etc. It would be nice to use the UI that Unity has, but be able to (quite honestly) not auto launch and Build with XCode because it almost never works for any given version of Unity and XCode. A quick inspection of EditorBuildSettings, which I was hoping could be used to get the info from the build options scene, only contains the scenes array.

Functionally, can any Unity employee tell me the line of code invoked by File–>Build Settings—>Click “Build” Button?

1 Like

There now is a way to override this behaviour. Unfortunately, it’s buried somewhere in a great blog post a Unity Dev did about “new features in 2017.x that didn’t get a mention in our blogs”.