LinuxCommandLibrary

bundletool

Build Android App Bundles and APK sets

TLDR

Display help for a subcommand

$ bundletool help [subcommand]
copy

Generate APKs from an application bundle (prompts for keystore password)
$ bundletool build-apks --bundle [path/to/bundle.aab] --ks [path/to/key.keystore] --ks-key-alias [key_alias] --output [path/to/file.apks]
copy

Generate APKs from an application bundle giving the keystore password
$ bundletool build-apks --bundle [path/to/bundle.aab] --ks [path/to/key.keystore] --ks-key-alias [key_alias] --ks-pass [pass:the_password] --output [path/to/file.apks]
copy

Generate APKs including only one single APK for universal usage
$ bundletool build-apks --bundle [path/to/bundle.aab] --mode [universal] --ks [path/to/key.keystore] --ks-key-alias [key_alias] --output [path/to/file.apks]
copy

Install the right combination of APKs to an emulator or device
$ bundletool install-apks --apks [path/to/file.apks]
copy

Estimate the download size of an application
$ bundletool get-size total --apks [path/to/file.apks]
copy

Generate a device specification JSON file for an emulator or device
$ bundletool get-device-spec --output [path/to/file.json]
copy

Verify a bundle and display detailed information about it
$ bundletool validate --bundle [path/to/bundle.aab]
copy

SYNOPSIS

bundletool <command> [options] [--help] [--version]

PARAMETERS

build-apks
    Generates .apks archive from input .aab or .apks bundle.

install-apks
    Installs .apks on connected device/emulator via ADB.

validate
    Checks .aab or .apks for errors and Play Store compliance.

get-size
    Calculates download sizes for .apks targeting devices/locales.

generate-delta
    Creates delta .apks from base and new full bundles.

extract-apks
    Extracts APKs from .apks archive to directory.

version
    Displays bundletool version information.

--help
    Shows help for command or subcommand.

--version
    Prints bundletool version.

-h
    Alias for --help.

DESCRIPTION

Bundletool is a command-line tool developed by Google for working with Android App Bundles (AAB), the publishing format for the Google Play Store. It enables developers to generate APK set archives (.apks files) from AABs, which contain optimized APKs for specific device configurations, supporting features like dynamic delivery, split APKs, and on-demand modules.

Key uses include local testing by building and installing APKs without the Play Console, validating bundles for compliance, estimating download sizes, generating delta updates for faster incremental installs, and extracting individual APKs. It's integral for CI/CD workflows, sideloading apps, and analyzing bundle efficiency.

Invoked via java -jar bundletool.jar (or aliased as bundletool), it requires a Java Runtime Environment (JRE 8+). Supports device targeting by ABI, screen density, language, and SDK version. Ensures APKs are signed correctly and verifies bundle integrity against Play Store requirements. Widely used since Android's shift to AABs, replacing traditional APKs for new apps.

CAVEATS

Requires Java 8+; run as java -jar bundletool-all-*.jar. Needs ADB for installs. Not for unsigned bundles. Large bundles may need ample memory.

INSTALLATION

Download bundletool-all-*.jar from GitHub; chmod +x for executable use, or alias 'bundletool="java -jar /path/to/bundletool.jar"'.

COMMON WORKFLOW

bundletool build-apks --bundle=app.aab --output=app.apks --ks=keystore.jks --ks-key-alias=key
Then bundletool install-apks --apks=app.apks.

HISTORY

Released by Google in 2018 alongside Android App Bundles (Android Studio 3.2+). Evolved with Play Core Library; version 1.0+ standardized APK sets. Actively maintained for App Bundle features.

SEE ALSO

adb(1), aapt2(1), apkanalyzer(1), keytool(1)

Copied to clipboard