bundletool
Manipulate Android App Bundles and APKs
TLDR
Build APK set from app bundle
$ bundletool build-apks --bundle=[app.aab] --output=[app.apks]
Build APKs with signingcopy
$ bundletool build-apks --bundle=[app.aab] --output=[app.apks] --ks=[keystore.jks] --ks-key-alias=[alias]
Install APKs to connected devicecopy
$ bundletool install-apks --apks=[app.apks]
Extract APKs for specific devicecopy
$ bundletool extract-apks --apks=[app.apks] --output-dir=[output] --device-spec=[device.json]
Get device specificationcopy
$ bundletool get-device-spec --output=[device.json]
Validate app bundlecopy
$ bundletool validate --bundle=[app.aab]
Print bundle infocopy
$ bundletool dump manifest --bundle=[app.aab]
Build universal APK containing all configurationscopy
$ bundletool build-apks --mode=universal --bundle=[app.aab] --output=[app.apks]
Build APKs for the connected device onlycopy
$ bundletool build-apks --connected-device --bundle=[app.aab] --output=[app.apks]
Get APK size estimatescopy
$ bundletool get-size total --apks=[app.apks]
copy
SYNOPSIS
bundletool command [options]
DESCRIPTION
bundletool is the command-line tool for manipulating Android App Bundles. It builds app bundles, generates APK sets for various device configurations, and installs APKs to connected devices.The tool is used by Android Studio, the Android Gradle plugin, and Google Play to build and process Android App Bundles.
PARAMETERS
--bundle file
Path to Android App Bundle (.aab)--output file
Output file path--apks file
Path to APK set archive--device-spec file
Device specification JSON file--ks file
Path to keystore for signing--ks-pass pass
Keystore password (pass:password or file:/path)--ks-key-alias alias
Key alias in keystore--key-pass pass
Key password (pass:password or file:/path)--connected-device
Target only the currently connected Android device's configuration.--device-id serial
Specify a device by ADB serial number.--mode mode
APK generation mode: default, universal, system, persistent, instant, archive.--local-testing
Add metadata for local feature module (dynamic delivery) testing.--overwrite
Overwrite existing output file.--aapt2 path
Path to a custom AAPT2 binary.
COMMANDS
build-bundle
Build Android App Bundle from module zip filesbuild-apks
Generate APK set from app bundleextract-apks
Extract APKs for specific device configurationinstall-apks
Install APKs to connected deviceget-device-spec
Write device specification to JSON filevalidate
Verify app bundle validitydump
Print bundle information in human-readable formget-size
Compute download size estimatesversion
Print bundletool version
CAVEATS
Requires Java Runtime Environment. Device installation requires ADB and a connected Android device. Signed APKs require keystore credentials. App bundles must be valid according to Android App Bundle specification.