A powerful, cross-platform command-line tool for converting Android App Bundle (.aab) files to APK format with automatic dependency management and user-friendly features. Available for both Linux and Windows.
- π 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
- π» Cross-Platform - Works on Linux (Ubuntu/Debian) and Windows (10/11)
- π¨ 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
- OS: Windows 10/11
- PowerShell: 5.1 or later (included in Windows 10/11)
- Internet: Required for bundletool download
The tool will automatically detect and install:
- Java Development Kit (JDK 8+)
- Bundletool (Google's AAB conversion tool)
- curl (Linux) or Invoke-WebRequest (Windows PowerShell)
Tip
AAB File Placement: You can place your .aab files either in the script directory (linux/ or windows/) or in the parent directory for convenience. The tool automatically searches both locations.
# Clone the repository
git clone https://github.com/yourusername/apk_builder.git
cd apk_builder/linux
# Make the script executable
chmod +x main.sh
# Run the script (dependencies will be auto-installed)
./main.sh# Clone the repository
git clone https://github.com/yourusername/apk_builder.git
cd apk_builder\windows
# Set execution policy (if needed, run PowerShell as Administrator)
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
# Run the script (dependencies will be auto-installed)
.\main.ps1
# OR use the Batch wrapper (automatically bypasses execution policy)
.\main.bat# Download the script
wget https://raw.githubusercontent.com/yourusername/apk_builder/main/linux/main.sh
# Make executable
chmod +x main.sh
# Run
./main.sh# Download the repository as ZIP or clone with git
# Extract to a folder and navigate to windows directory
# Set execution policy (run PowerShell as Administrator)
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
# Run
.\main.ps1
# OR use the Batch wrapper
.\main.bat# Interactive conversion (default)
cd linux
./main.sh
# Silent conversion (no verbose output)
./main.sh --quiet
# Batch conversion (non-interactive)
./main.sh --non-interactive
# Custom output directory
./main.sh --output ./apks --verbose
# Validate AAB files
./main.sh validate
# Show AAB file information
./main.sh info
# Show help
./main.sh --help
# Show version
./main.sh --version# Interactive conversion (default)
cd windows
.\main.ps1
# Silent conversion (no verbose output)
.\main.ps1 -Quiet
# Batch conversion (non-interactive)
.\main.ps1 -NonInteractive
# Using main.bat wrapper
.\main.bat -NonInteractive
# Custom output directory
.\main.ps1 -Output .\apks -Verbose
# Validate AAB files
.\main.ps1 -Command validate
# Show AAB file information
.\main.ps1 -Command info
# Show help
.\main.ps1 -Help
# Show version
.\main.ps1 -Version# Custom keystore configuration
./main.sh --keystore my-key.keystore --alias my-alias --password mypassword
# Different build modes
./main.sh --mode universal # Default: single APK for all devices
./main.sh --mode system # System-signed APK
./main.sh --mode persistent # Persistent APK
# Enable logging to file
./main.sh --log conversion.log# Custom keystore configuration
.\main.ps1 -Keystore my-key.keystore -Alias my-alias -Password mypassword
# Different build modes
.\main.ps1 -Mode universal # Default: single APK for all devices
.\main.ps1 -Mode system # System-signed APK
.\main.ps1 -Mode persistent # Persistent APK
# Enable logging to file
.\main.ps1 -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 main.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
./main.sh --keystore my-release-key.keystore --alias my-key-alias --password yourpassword# Run PowerShell as Administrator and execute:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
# Or for current session only:
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
# TIP: Using main.bat automatically handles execution policy bypass for you.# Download and install Java JDK from:
# https://adoptium.net/ (recommended)
# or https://www.oracle.com/java/technologies/downloads/
# Verify installation
java -version# Check internet connection
Test-NetConnection github.com -Port 443
# Manual download if needed
Invoke-WebRequest -Uri "https://github.com/google/bundletool/releases/download/1.18.2/bundletool-all-1.18.2.jar" -OutFile "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
.\main.ps1 -Keystore my-release-key.keystore -Alias my-key-alias -Password yourpassword# Make sure you're in the correct directory
cd path\to\apk_builder\windows
# Run with full path if needed
& "C:\path\to\apk_builder\windows\main.ps1"| 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 |
Execution Policy (Windows) |
PowerShell security policy | Run Set-ExecutionPolicy RemoteSigned -Scope CurrentUser |
apk_builder/
βββ README.md # This documentation
βββ .gitignore # Git ignore file
βββ linux/ # Linux CLI files
β βββ main.sh
βββ windows/ # Windows PowerShell files
β βββ main.ps1
β βββ main.bat # Batch entry point
βββ 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
We welcome contributions! Whether it's:
- π Bug fixes
- β¨ New features
- π Documentation improvements
- π Platform support (macOS, etc.)
- π§ͺ Testing and quality assurance
Please read our Contributing Guidelines for details on:
- Development setup
- Code style guidelines
- Submitting pull requests
- Reporting bugs
- Requesting features
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes and test thoroughly
- Commit:
git commit -m 'feat: add amazing feature' - Push:
git push origin feature/amazing-feature - Open 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 and Windows communities for excellent platform support
- All contributors who help improve this tool
- π Bug Reports: Create an Issue
- π‘ Feature Requests: Create an Issue
- π€ Contributing: See CONTRIBUTING.md
- π§ Email: bugiriwilson651@gmail.com
- Android App Bundle Documentation
- Bundletool GitHub Repository
- Android Studio Releases
- PowerShell Documentation
If this tool helped you, consider giving it a β on GitHub!