So when you build for Android, Unity starts the build, compiles scripts, converts classes to dex format, finds a device and installs/launches the game on it.
In the build settings there are two things you need to specify: the cube store password and the bundle identifier.
The problem is, if you fail to provide the cube password correctly, Unity won’t tell you that you don’t have a correct password right away but instead stupidly continues the build process and lets you at 75% of it.
Same thing for the bundle identifier, if it’s older than the one installed on the device it screams unable to install downgraded version etc.
It blows my mind that it has to wait till almost the end of the build to do those checks, why not abort immediately at the beginning?
I’ve wasted so much time and got frustrated because of that…
Is there any way to intercept/customize this build process to do those checks at the beginning? I could ILSpy the editor code and try to figure out what the ‘Build’ button does (pretty sure I’ll end up in a closed end/extern’ed code). But before I try that was wondering if there’s a legitimate way to do it without resorting to hacks…
As far as I know, there’s still no “pre-build event”, and custom scripting buildPipeline is more of a pain than it’s ever worth, especially after you’ve tried to manage it so your script does what you want across multiple platforms, local dev builds, a continuous build machine, release process etc.
“Use the buildpipeline class” is similar to “use assetbundles instead of just loading a single level.” It totally gives you that control, at the expense of breaking almost every advantage of simplicity and workflow that made you use Unity in the first place.
The closest we’ve every got is a manually invoked “set everything up” editor script, that sets values in PlayerSettings, so you can THEN run your regular build process with ctrl-b.
You can use post build events to fudge up your XCodeProj for stuff like version numbers after the build but there’s not really any way to do anything useful on Android.
Unfortunately, exact requirements around build process are very project specific, and the Unity core team does an excellent job of ignoring problems with ambiguous requirements.