How to Generate a Signed App Bundle in Android Studio
Create an upload keystore and a signed release .aab in Android Studio, set versionCode and targetSdk correctly, and check the bundle before uploading to Play.
Short answer
In Android Studio choose Build → Generate Signed App Bundle or APK, pick Android App Bundle, create a new keystore (or pick your existing upload key), select the release variant and finish. The .aab is written to app/release/. Make sure versionCode is new and targetSdk is 36 before you build.
Before you build
Open app/build.gradle(.kts) and check:
| Setting | What it should be |
|---|---|
| applicationId | Your permanent package name. Not com.example |
| versionCode | Higher than any build you’ve uploaded |
| versionName | What users see, like 1.0.0 |
| targetSdk / compileSdk | 36 or higher (required since August 31, 2026) |
| minifyEnabled (release) | On if you use R8. Test the release build |
Step by step in Android Studio
- Build → Generate Signed App Bundle or APK.
- Choose Android App Bundle, then Next.
- Key store path: create a new one the first time. Choose a strong password, an alias, and a validity of 25+ years. Fill in at least one certificate field.
- Tick Export encrypted key only if you plan to enrol in Play App Signing with an existing key. For new apps, Play App Signing is set up automatically when you upload.
- Select the release build variant and click Create.
- Find the .aab in app/release/ (Studio shows a link when it finishes).
Keep your keystore safe
- Store it outside the project, in a password manager plus one offline backup.
- Never commit it to Git.
- With Play App Signing, this is your upload key. If it’s lost you can request a reset, but that takes time.
Check the bundle before uploading
- Install it locally with bundletool to test the exact release build on a device.
- Run Analyze APK/Bundle in Studio to spot huge assets or libraries.
- Make sure only the permissions you need are in the merged manifest. Each affects your Data safety form.
Automating it
Once it works by hand, move signing to Gradle with the passwords in environment variables, so CI can run ./gradlew bundleRelease.
Next: upload your first AAB to Play Console.
Frequently asked questions
How long should the keystore be valid for?
Choose a long validity, such as 25 years or more. Your upload certificate must stay valid for as long as you upload updates.
Should I enable R8 minification?
For release builds it usually reduces size and obfuscates code. Test the release build carefully and keep mapping files so crash traces stay readable.
Can I build a bundle from the command line?
Yes. Run the Gradle bundleRelease task with a signing config. That’s what CI systems use.
Sources and how we keep this accurate
- Android Developers: About Android App Bundles
- Play Console Help: Use Play App Signing
- Android Developers: Version your app
- Android Developers: Sign your app
Policy facts are checked against Google's own documentation on the date shown above. Google can change requirements at any time, so confirm in your Play Console. Where we give advice or estimates rather than Google's rules, we say so. TestersZone is independent and not affiliated with Google. Drafts are AI-assisted and reviewed by our team.
Need 12 testers? Get them free.
Test 3 apps, earn 60 credits, and list your app for up to 20 real testers with verified daily check-ins.
Start freeKeep reading
How to Upload Your First App Bundle to Play Console
AAB vs APK: What Google Play Needs and Why
Lost Your Upload Key? How Play App Signing Saves You
How to Publish a FlutterFlow App on Google Play
How to Publish an AI-Built (“Vibe-Coded”) App on Google Play
How to Publish a PWA on Google Play With a Trusted Web Activity
Browse all guides, or see the quick answers, guides and comparisons.