A powerful, Linux-optimized command-line tool for converting Android App Bundle (.aab) files to APK format with automatic dependency management and user-friendly features.
- π One-Click Conversion - Convert multiple AAB files to APK format instantly
- β Bundle Validation - Verify AAB file integrity before conversion
- π File Information - Display detailed AAB bundle metadata
- π§ Auto Dependency Management - Automatically detect and install missing dependencies
- π» Linux Optimized - Built specifically for Ubuntu/Debian systems
- π¨ Colored Output - Beautiful, informative terminal output with emojis
- π Verbose Logging - Detailed progress information and error reporting
- π Keystore Support - Custom signing configuration for APK generation
- π Flexible Output - Custom output directory support
- OS: Ubuntu/Debian-based Linux distribution
- Architecture: x86_64 or ARM64
- Internet: Required for bundletool download
The tool will automatically detect and install:
- Java Runtime Environment (JRE 8+)
- curl (for downloads)
- findutils (file searching)
- coreutils (system utilities)
- Bundletool (Google's AAB conversion tool)
# Clone the repository
git clone https://github.com/yourusername/apk_builder.git
cd apk_builder
# Make the script executable
chmod +x builder.sh
# Run the script (dependencies will be auto-installed)
./builder.sh# Download the script
wget https://raw.githubusercontent.com/yourusername/apk_builder/main/builder.sh
# Make executable
chmod +x builder.sh
# Run
./builder.sh# Interactive conversion (default)
./builder.sh
# Silent conversion (no verbose output)
./builder.sh --quiet
# Batch conversion (non-interactive)
./builder.sh --non-interactive
# Custom output directory
./builder.sh --output ./apks --verbose
# Validate AAB files
./builder.sh validate
# Show AAB file information
./builder.sh info
# Show help
./builder.sh --help
# Show version
./builder.sh --version# Custom keystore configuration
./builder.sh --keystore my-key.keystore --alias my-alias --password mypassword
# Different build modes
./builder.sh --mode universal # Default: single APK for all devices
./builder.sh --mode system # System-signed APK
./builder.sh --mode persistent # Persistent APK
# Enable logging to file
./builder.sh --log conversion.log| Command | Description |
|---|---|
convert |
Convert AAB files to APKs (default) |
validate |
Validate AAB bundle integrity |
info |
Show detailed AAB file information |
help |
Display help message |
| Option | Description | Default |
|---|---|---|
-h, --help |
Show help message | |
-v, --verbose |
Enable verbose output | β Enabled |
--quiet |
Disable verbose output | |
-i, --interactive |
Interactive mode | β Enabled |
-n, --non-interactive |
Non-interactive mode | |
-o, --output DIR |
Output directory | Current directory |
-k, --keystore PATH |
Keystore file path | my-release-key.keystore |
-a, --alias ALIAS |
Keystore alias | my-key-alias |
-p, --password PASS |
Keystore password | 123456 |
-m, --mode MODE |
Build mode | universal |
-l, --log FILE |
Log output to file | |
-V, --version |
Show version information |
# Initial run - will detect and install dependencies
./builder.sh
# Output:
# π Checking Dependencies...
# β’ Java Runtime Environment... β
Found (11.0.16)
# β’ curl... β
Found (7.81.0)
# β’ find utility... β
Found
# β’ disk utility (du)... β
Found
# β’ Bundletool jar... β Missing
#
# β οΈ Missing Dependencies Detected:
# - Bundletool 1.18.2
#
# π Actions to be taken:
# - Download Bundletool 1.18.2 from GitHub
#
# π€ Would you like me to automatically install/download these missing dependencies? [y/N]: y
#
# π§ Installing missing dependencies...
#
# β€ Processing: Bundletool 1.18.2
# π Downloading bundletool 1.18.2...
# π‘ URL: https://github.com/google/bundletool/releases/download/1.18.2/bundletool-all-1.18.2.jar
# πΎ Target: ./bundletool-all-1.18.2.jar
# β
Download completed (3.2M)
#
# π All dependencies installed successfully!# Place your .aab files in the directory
ls *.aab
# app-release.aab game-debug.aab tools-prod.aab
# Convert all files
./builder.sh --output ./converted_apks
# Output:
# π Checking AAB files...
# π Found 3 AAB file(s):
# -rw-r--r-- 1 user user 12M Oct 28 07:15 app-release.aab
# -rw-r--r-- 1 user user 8.5M Oct 28 07:15 game-debug.aab
# -rw-r--r-- 1 user user 15M Oct 28 07:15 tools-prod.aab
#
# π¦ Processing: app-release.aab
# π Converting to ./converted_apks/app-release.apks...
# π Created: ./converted_apks/app-release.apks
#
# π¦ Processing: game-debug.aab
# π Converting to ./converted_apks/game-debug.apks...
# π Created: ./converted_apks/game-debug.apks
#
# π¦ Processing: tools-prod.aab
# π Converting to ./converted_apks/tools-prod.apks...
# π Created: ./converted_apks/tools-prod.apks
#
# π All conversions completed successfully!./builder.sh validate
# Output:
# π Checking AAB files for validation...
# π Found 2 AAB file(s):
#
# π Validating: app-release.aab
# β
Valid AAB: app-release.aab
# Bundle validation successful
#
# π Validating: corrupted-bundle.aab
# β Validation failed for corrupted-bundle.aab
# ERROR: Invalid bundle file
#
# β οΈ Validation completed with 1 invalid file(s)chmod +x builder.sh# The tool will automatically offer to install Java
sudo apt update
sudo apt install -y openjdk-21-jre# Check internet connection
curl -I https://github.com/google/bundletool/releases/latest
# Manual download if needed
wget https://github.com/google/bundletool/releases/download/1.18.2/bundletool-all-1.18.2.jar# Generate a new keystore
keytool -genkey -v -keystore my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000
# Use custom keystore
./builder.sh --keystore my-release-key.keystore --alias my-key-alias --password yourpassword| Error | Cause | Solution |
|---|---|---|
π« No AAB files found |
No .aab files in directory | Place .aab files in current directory |
β Java is required |
Java not installed | Allow auto-install or install manually |
β Failed to download bundletool |
Network issues | Check internet connection or download manually |
π₯ Conversion failed |
Invalid AAB file | Use validate command to check file integrity |
apk_builder/
βββ builder.sh # Main script
βββ README.md # This documentation
βββ .gitignore # Git ignore file
βββ examples/ # Example AAB files (optional)
βββ logs/ # Log files directory (auto-created)After conversion, you'll find:
*.apks- APK bundle files (can be installed directly)conversion.log- Detailed conversion log (if logging enabled)
# Set custom output directory
export APK_BUILDER_OUTPUT="./my_apks"
# Set custom keystore
export APK_BUILDER_KEYSTORE="./keys/release.keystore"
export APK_BUILDER_ALIAS="release"
export APK_BUILDER_PASSWORD="mypass123"The tool includes a default keystore for testing:
- File:
my-release-key.keystore - Alias:
my-key-alias - Password:
123456
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and test thoroughly
- Commit your changes:
git commit -m 'Add feature' - Push to the branch:
git push origin feature-name - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Google for the Bundletool utility
- Android community for AAB format support
- Ubuntu/Debian for excellent package management
- π Bug Reports: Create an Issue
- π‘ Feature Requests: Create an Issue
- π§ Email: bugiriwilson651@gmail.com
If this tool helped you, consider giving it a β on GitHub!