DEV Community

Cover image for 📱From APK to .aab: Master the Modern Way to Build & Ship Android Apps
AYON KARMAKAR
AYON KARMAKAR

Posted on

📱From APK to .aab: Master the Modern Way to Build & Ship Android Apps

📦 What is an Android App Bundle (.aab)?

An App Bundle (.aab) is the official publishing format for Android apps on the Google Play Store, replacing the older APK format for new apps.


🔹 What is an App Bundle?

An App Bundle is a publishing format that includes all your app’s compiled code, resources, and assets — but it defers APK generation and signing to Google Play.

Rather than shipping a single monolithic APK, the .aab allows Google Play to create and serve optimized APKs tailored for each user’s device configuration.


🔹 Why Use an App Bundle?

Google Play uses Dynamic Delivery to generate and deliver only the necessary code and resources to a user’s device.

✅ Benefits:

  • Smaller download sizes
  • Smaller installed app sizes
  • Faster installation times
  • Less storage usage

🔹 Example

Let’s say your app supports:

  • ARM and x86 architectures
  • Multiple screen densities
  • Multiple languages

Instead of including everything in one APK, Play Store builds a custom APK for each user — e.g., only ARM64 architecture + English language + xxhdpi screen resources — reducing the total size significantly.


🔹 App Bundle vs APK

Feature .apk (Android Package) .aab (App Bundle)
Format Final, installable package Upload format for Play Store
Contains All resources and architectures Modular resources and code
Upload to Play Store ✅ Yes ✅ Yes (mandatory for new apps)
Install Locally ✅ Yes (via ADB) ❌ No (use generated APKs instead)
Size Optimization ❌ Manual ✅ Automatic (via Play Store)

🔹 When Should You Use .aab?

  • Mandatory for new apps on Google Play.
  • Highly recommended for all apps to improve performance and reduce APK size.

🔹 How to Build an App Bundle in Android Studio?

  1. Open your project in Android Studio.
  2. Navigate to: Build > Build Bundle(s) / APK(s) > Build Bundle(s)
  3. The generated .aab file will be located at: app/build/outputs/bundle/

🔹 Notes

  • You cannot install a .aab file directly on a device.
  • To test locally, you can use bundletool to convert .aab to APKs:
  bundletool build-apks --bundle=my_app.aab --output=my_app.apks --ks=mykey.jks ...
Enter fullscreen mode Exit fullscreen mode

📌 Conclusion

App Bundles offer a modern, efficient, and scalable way to distribute Android apps by optimizing them per device using Dynamic Delivery. While APKs are still useful for testing, .aab is now the standard for production builds on Google Play.

Top comments (0)