DEV Community

Cover image for How to Generate APK from AAB File Using Bundletool (Super Simple Guide)
Rajen Trivedi
Rajen Trivedi

Posted on

How to Generate APK from AAB File Using Bundletool (Super Simple Guide)

Hey devs! πŸ‘‹

We all know Google Play now prefers Android App Bundles (AAB) for publishing because they generate optimized APKs for each device.

But in real-world development, we often need a single APK for:

  • Testing on physical devices
  • Sharing with QA teams
  • Quick installs without Play Store

Here is the easiest and official way to convert your .aab file into an .apk using Google’s Bundletool.


πŸ› οΈ Step 1: Download Bundletool

  1. Go to the official GitHub releases:
    πŸ‘‰ https://github.com/google/bundletool/releases/latest

  2. Download the latest file:

   bundletool-all-x.x.x.jar
Enter fullscreen mode Exit fullscreen mode
  1. Place the .jar file:
  • In the same folder as your .aab file OR
  • Remember its full path

βš™οΈ Step 2: Generate .apks File (Universal Mode)

Open Command Prompt (Windows) or Terminal (Mac/Linux) and run:

java -jar bundletool-all-1.18.3.jar build-apks --bundle=app-release.aab --output=myapp.apks --mode=universal
Enter fullscreen mode Exit fullscreen mode

πŸ” Replace:

  • bundletool-all-1.18.3.jar β†’ your actual jar filename
  • app-release.aab β†’ your AAB file path/name

πŸ“¦ Output:

myapp.apks
Enter fullscreen mode Exit fullscreen mode

By default, this is signed with a debug keystore.


πŸ“¦ Step 3: Extract the APK

  1. Rename the file:
   ren myapp.apks myapp.zip
Enter fullscreen mode Exit fullscreen mode
  1. Extract it using:
  • WinRAR
  • 7-Zip
  • Default OS extractor
  1. Inside, you’ll find:
   universal.apk
Enter fullscreen mode Exit fullscreen mode

πŸŽ‰ That’s your final APK!

You can rename it:

app-release.apk
Enter fullscreen mode Exit fullscreen mode

πŸ” Generate Signed APK (Recommended for QA)

If you want a release-signed APK, use your keystore:

java -jar bundletool-all-1.18.3.jar build-apks \
  --bundle=app-release.aab \
  --output=myapp.apks \
  --mode=universal \
  --ks=your-keystore.jks \
  --ks-key-alias=your_alias \
  --ks-pass=pass:your_keystore_password \
  --key-pass=pass:your_key_password
Enter fullscreen mode Exit fullscreen mode

🧠 Common Tips & Troubleshooting

  • βœ… Check Java installation:
  java -version
Enter fullscreen mode Exit fullscreen mode
  • πŸ“ Keep files in the same folder to avoid path issues

  • πŸ“¦ Universal APK is larger (contains all device configs)

  • 🚫 Not for Play Store β€” upload AAB only

  • ❌ Error: Unable to access jarfile

    • Check filename and path carefully

🏁 Conclusion

That’s it! 🎯

In less than 2 minutes, you can convert any .aab into an .apk using Bundletool β€” no GUI tools needed.

If you run into any issues, drop the error in the comments β€” happy to help! 😊


Top comments (0)