Android Beginners

Lesson 29: Signing Your App and Creating a Release Build

Ahmad Najar Ahmad Najar 1 min read

Signing Your App and Creating a Release Build

Every app installed on a real device must be cryptographically signed. Here's how to generate your signing key and produce a real release build.

Generating a signing key

In Android Studio: Build → Generate Signed App Bundle / APK → choose Android App Bundle (the format the Play Store requires) → Create new... under key store path.

Fill in the key store form and save the password and file somewhere safe — if you lose this key later, you cannot update your app on the Play Store under the same listing ever again. This is the single most important file in the entire release process.

Debug vs. release builds

Everything you've run so far used a debug build — auto-signed with a throwaway key Android Studio manages for you, and not optimized. A release build is signed with your real key and runs through R8, which shrinks and obfuscates your code for a smaller, harder-to-reverse-engineer final app.

Why App Bundle, not APK

An App Bundle (.aab) isn't installed directly — Google Play uses it to generate an optimized APK for each specific device that downloads your app (only the resources and code that device actually needs). This produces a meaningfully smaller download than a single universal APK, and it's now the required format for new apps on the Play Store.

Test the release build before uploading anything

Install the generated .aab (via bundletool, or simpler: build a release APK variant instead just for local testing) on a real device and click through your whole app once. R8's code shrinking occasionally breaks something that worked fine in debug — catching that now is much less painful than after your Play Store submission is already under review.

Next: Lesson 30 — the final step: publishing to the Google Play Store.

Android Beginners