---
title: Publish Android App Bundles
description: Publish Android App Bundles (AAB) from Capawesome Cloud to Google Play — smaller downloads, automatic R8 crash deobfuscation, and easy migration from APK.
---

# Publish Android App Bundles

The [Android App Bundle](https://developer.android.com/guide/app-bundle/app-bundle-format){:target="_blank"} (`.aab`) is the publishing format Google Play **requires for new apps** since August 2021, and the recommended format for all apps. Capawesome Cloud builds an AAB alongside the APK on every Android build, so no configuration is needed — you just pick the AAB when you publish.

## Why app bundles

- **Required by Google Play**: New apps must be published as app bundles. APK uploads are only still accepted for apps that existed before the requirement.
- **Smaller downloads**: Google Play generates APKs optimized for each device configuration and language from your bundle, so users download only what they need.
- **Metadata included**: The bundle carries build metadata for Google Play — most notably the R8/ProGuard mapping file used to deobfuscate crash reports automatically (see [Code shrinking with R8](#code-shrinking-with-r8)).

## Download the AAB

=== "CLI"

    Use [`apps:builds:download`](../cli/commands.md#appsbuildsdownload) with the `--aab` flag — optionally followed by a file path:

    ```bash
    npx @capawesome/cli apps:builds:download --aab ./app.aab
    ```

=== "Console"

    Open the build's detail page from the [Builds](https://console.cloud.capawesome.io/apps/_/builds){:target="_blank"} page and download the AAB artifact.

See [Monitor a build](monitor-builds.md) for more on working with finished builds.

## Publish to Google Play

You can publish the AAB in two ways:

- **Manually**: Download the AAB and upload it to a release in Google Play Console.
- **Automatically**: Set up a [Google Play Store destination](../app-store-publishing/destinations/google-play-store.md) with the publishing format `AAB` and let Capawesome Cloud [submit your builds](../app-store-publishing/submit-a-build.md) for you.

## Migrate an existing app from APK

If your app still publishes APKs, enroll it in [Play App Signing](https://support.google.com/googleplay/android-developer/answer/9842756){:target="_blank"} in Google Play Console — you upload your existing app signing key once, and Google Play signs the APKs it generates from your bundles with it. From then on, upload app bundles instead of APKs.

Nothing changes in Capawesome Cloud: keep signing your builds with the same keystore as before (see [Android signing certificates](certificates/android.md)). It simply becomes your upload key.

## Code shrinking with R8

To shrink and obfuscate your app with R8, enable minification for the release build type in your app module's `build.gradle` file (for Capacitor projects, `android/app/build.gradle`):

```groovy
android {
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}
```

R8 renames classes and methods during the build, which makes production stack traces unreadable. To deobfuscate them, Google Play needs the mapping file generated by that exact build. When you publish an AAB, this happens automatically: the mapping file is embedded in the bundle's `BUNDLE-METADATA/` directory, and Google Play extracts and applies it to crash and ANR reports — you never have to handle a `mapping.txt` file yourself.

!!! note

    When publishing an APK, Google Play requires you to upload the `mapping.txt` file manually. The mapping file is not available as a separate build artifact in Capawesome Cloud — publish an Android App Bundle instead, which includes it automatically.

## Next steps

- [Monitor a build](monitor-builds.md) — track status and download artifacts.
- [Set up signing certificates](certificates/android.md) — sign your release builds.
- [Google Play Store destination](../app-store-publishing/destinations/google-play-store.md) — submit AABs to Google Play automatically.
