Skip to content

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.

Updated 3 min readBy the TestersZone team

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:

SettingWhat it should be
applicationIdYour permanent package name. Not com.example
versionCodeHigher than any build you’ve uploaded
versionNameWhat users see, like 1.0.0
targetSdk / compileSdk36 or higher (required since August 31, 2026)
minifyEnabled (release)On if you use R8. Test the release build

Step by step in Android Studio

  1. Build → Generate Signed App Bundle or APK.
  2. Choose Android App Bundle, then Next.
  3. 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.
  4. 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.
  5. Select the release build variant and click Create.
  6. 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

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 free

Keep reading

Browse all guides, or see the quick answers, guides and comparisons.