LinuxCommandLibrary

bundletool

Manipulate Android App Bundles and APKs

TLDR

Build APK set from app bundle

$ bundletool build-apks --bundle=[app.aab] --output=[app.apks]
copy
Build APKs with signing
$ bundletool build-apks --bundle=[app.aab] --output=[app.apks] --ks=[keystore.jks] --ks-key-alias=[alias]
copy
Install APKs to connected device
$ bundletool install-apks --apks=[app.apks]
copy
Extract APKs for specific device
$ bundletool extract-apks --apks=[app.apks] --output-dir=[output] --device-spec=[device.json]
copy
Get device specification
$ bundletool get-device-spec --output=[device.json]
copy
Validate app bundle
$ bundletool validate --bundle=[app.aab]
copy
Print bundle info
$ bundletool dump manifest --bundle=[app.aab]
copy
Get APK size estimates
$ 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-key-alias alias
Key alias in keystore
--connected-device
Use specification from connected device

COMMANDS

build-bundle

Build Android App Bundle from module zip files
build-apks
Generate APK set from app bundle
extract-apks
Extract APKs for specific device configuration
install-apks
Install APKs to connected device
get-device-spec
Write device specification to JSON file
validate
Verify app bundle validity
dump
Print bundle information in human-readable form
get-size
Compute download size estimates
version
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.

SEE ALSO

adb(1), apksigner(1), zipalign(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community