bundletool-dump
Inspect details of an Android App Bundle
TLDR
Display the AndroidManifest.xml of the base module
Display a specific value from the AndroidManifest.xml using XPath
Display the AndroidManifest.xml of a specific module
Display all the resources in the application bundle
Display the configuration for a specific resource
Display the configuration and values for a specific resource using the ID
Display the contents of the bundle configuration file
SYNOPSIS
bundletool dump
(--bundle=path/to/bundle.aab | --apk=path/to/apk.apk)
[--manifest] [--resources] [--signatures] [--config] [--device-spec]
[--output-file=output_file_path]
[--verbose] [--version] [--help]
PARAMETERS
--bundle=path
Specifies the path to the Android App Bundle (.aab) file to be analyzed. This option is mutually exclusive with --apk.
--apk=path
Specifies the path to the Android Package Kit (.apk) file to be analyzed. This option is mutually exclusive with --bundle.
--manifest
Dumps the parsed content of the AndroidManifest.xml file present within the bundle or APK.
--resources
Dumps detailed information about the app's resources, including their configurations and values.
--signatures
Dumps information about the digital signatures applied to the APK, including certificate details.
--config
Dumps the bundle configuration details, such as min_sdk_version, target_sdk_version, supported ABIs, and screen densities.
--device-spec
Dumps the device specification that was used to build the APK, if available within the package.
--output-file=path
Specifies a file where the command's output should be written instead of printing to standard output (stdout).
--verbose
Enables more detailed and verbose output, providing additional information during the dump process.
--version
Displays the bundletool version information and then exits.
--help
Displays the help message and available options for the dump command and then exits.
DESCRIPTION
bundletool dump is a powerful subcommand of the Android Bundletool utility. It provides a comprehensive way to analyze the internal structure and metadata of Android App Bundles (.aab) and APK files (.apk). Developers, testers, and security analysts can use it to verify the contents of their builds, troubleshoot issues, understand how resources are packaged, inspect manifest declarations, and examine signing details. It's particularly useful for debugging app bundle configurations and ensuring that the final APKs generated by the bundle meet the expected specifications before distribution through platforms like Google Play.
CAVEATS
- Java Runtime Requirement: bundletool is a Java-based tool and requires a Java Runtime Environment (JRE) (version 11 or higher is recommended) to be installed and configured on the system.
- Not Pre-installed: bundletool is not typically pre-installed on Linux distributions. Users must manually download the executable JAR file from its official GitHub releases page and often add it to their system's PATH for convenient access.
- Verbose Output: Depending on the options used (e.g., --resources), the output can be very extensive. It is often beneficial to pipe the output to tools like grep or redirect it to a file for easier analysis.
INSTALLATION
bundletool is distributed as a single executable JAR file. To use it, download the latest bundletool-all.jar from its GitHub releases page. Once downloaded, it can be executed using Java: java -jar bundletool-all.jar dump ...
. For convenience, it's common practice to rename the JAR to bundletool and place it in a directory included in your system's PATH.
COMMON USE CASES
Beyond basic inspection, bundletool dump is invaluable for:
- Build Verification: Ensuring that specific build configurations (e.g., targeting particular ABIs or screen densities) are correctly applied and included within the app bundle or APK.
- Security Analysis: Examining the signing certificate details of an APK to verify its authenticity or detect tampering.
- Resource Management: Understanding how resources are packaged and split for different device configurations, which is crucial for optimizing app size and performance.
- Debugging Manifest Issues: Quickly identifying and resolving issues related to permissions, activities, or services declared in the AndroidManifest.xml.
HISTORY
bundletool was developed by Google and introduced alongside the Android App Bundle (AAB) format in 2018 as a core tool for packaging, signing, and deploying Android applications. The dump command was an integral part of its initial release, providing developers with the essential ability to inspect the new .aab format, as well as traditional .apk files. Its development was driven by the need to support the modular app delivery mechanism of App Bundles and to facilitate debugging and verification processes for app delivery through platforms like Google Play.
SEE ALSO
aapt2(1), apksigner(1)