Building an app in Release Mode

Hello everyone I am almost done with my app and ready to release, I have been looking but haven’t found information on this, are there any specific things or settings we need to change in our iOS or Android app to get rid of all debug code, or anything we need to configure to set for release mode ? thanks anybody who can give info on this greatly appreciated

For Android, I would suggest to use the command line tools within the proj.android folder. Just call ./gradlew build and you should find the generated APK in proj.android/app/build/outputs/apk (and the subfolders).

The iOS way is more complicated. I’m sure you’ll find tutorials on YouTube on how to deploy to the App Store. It’s the same way like an app.

1 Like

ok, sound good, theres nothing in the code or in the build files we need to configure ?

For Android it shouldn’t anything to do. You only need a release signing key and you’re good to go. If you’re using Android Studio, you can create it in the build menu.

1 Like

Beyond the physical build into release package already discussed, here’s some additional thoughts:

I believe the default project template already handles defining CCLOG as print out in debug and do nothing in release (similarly CC_ASSERT, and a few others), but you can check that your game isn’t logging unexpectedly (logcat or xcode device console).

Basically release mode should not define COCOS2D_DEBUG and/or define it with the value 0. Again, this should occur by default on a cocos new project.

If you have any test-mode features or in-game debug editors or configuration you will want to test out the release build (TestFlight or GooglePlay Beta/Alpha release) to make sure they’re unavailable.

You could confirm or modify compile optimization flags. I’m not sure what the default is, but you could look at -O3 (fast execution) or -Os (small size). Similarly you may want to remove debug flag -g from compile flags.

Lastly, you may not care about any of this if your app built for debug mode runs fine on lowest-end hardware, and don’t have sensitive data in your logs, etc.

(you can mostly just follow normal project release checklists)

2 Likes