Enable development build via script

I know there’s an option in the UCB web interface to enable Development builds; however, is this possible via scripting as well, during one of the pre-build methods for instance?

There’s BuildOptions.Development, but to my knowledge this has to be passed directly into the BuildPipeline.BuildPlayer() call, which is not accessible to us in UCB.

1 Like

You’re looking for EditorUserBuildSettings, specifically EditorUserBuildSettings.development. The class contains most settings you can make in the Build Settings window and allows you to change them from scripts.

3 Likes

Hm… I’ve tried setting this to true in my cloud build pre-build script, and when I print out the content of EditorUserBuildSettings.development it does show “True”; however, the resulting .apk is still not showing the “Development Build” watermark on-device.

1 Like

Any news on this? Looking for the same thing, I know there is an flag but I want full control in a script

1 Like

I also need this feature.

Implementing a full control of the build config from the script throught the combination of
IPreprocessBuildWithReport and Pre- and post-export methods.
But it looks like that Development Builds field from the Advanced options will be overriden no matter what we put inside EditorUserBuildSettings.development.

Now the only workaround I know is to manage Development flag in two places (with UCB interface for cloud builds and with EditorUserBuildSettings.development for local builds).

AFAIK UCB overwrites the .development setting as I remember from my own experiments.
So the only thing that works if you have two UCB build settings, one for development and one for production. That’s what I do and I’m happy with that.

@ruslan_seleznov local builds should not be needed anymore due to UCB. If you need them for local test, you simply set it up the way you need it and build.
Everything else is up to UCB to have builds that are done in a certain way.

What if you want to change some other build setting, such as IL2CPP Code generation (faster smaller builds) or similar? This is not possible through UCB atm?

Was interested too, there’s this:

Haven’t tried it yet though.

You should have a look at Unity - Scripting API: BuildOptions.Development