Convert your Android APK files to Android App Bundle (AAB) format for Google Play Store deployment.
This package automates the conversion of APK files to AAB (Android App Bundle) format using Google's bundletool, without requiring Android Studio. Perfect for publishing apps to the Google Play Store.
- ✅ Simple Installation:
pip install apk2abb - ✅ Automated Setup: Downloads bundletool automatically
- ✅ Certificate Management: Create and manage keystores
- ✅ APK to AAB Conversion: Convert APK files to AAB format
- ✅ Automatic Signing: Sign AAB files with your keystore
- ✅ AAB Analysis: Inspect AAB file contents
- ✅ Comprehensive Logging: Track all operations
- Java 11+: Required by Google's bundletool
java -version
- Python 3.7+: Required for running the package
- keytool: Usually comes with Java (for certificate management)
Install from PyPI:
pip install apk2abbOr install from source:
git clone https://github.com/nithin434/apk2abb.git
cd apk2abb
pip install -e .After installation, set up the required tools:
# Download bundletool
apk2abb-setup
# Create a keystore for signing
apk2abb-certThis will create the following directories in your current working directory:
tools/- Bundletool and other required toolscerts/- Your keystores and certificateslogs/- Log files from operationsoutput/- Generated AAB files
apk2abb-convert path/to/your-app.apkThat's it! Your AAB file will be created in the output/ directory.
apk2abb-analyze output/your-app.aabThe package provides four command-line tools:
Downloads and configures Google's bundletool:
apk2abb-setupCreates and manages keystores for signing:
apk2abb-certImportant: Change the default passwords in production! Edit the keystore credentials in certs/iot_marketplace_app.keystore.
Converts APK to AAB and signs it:
# Convert and sign
apk2abb-convert your-app.apk
# Convert without signing
apk2abb-convert your-app.apk --no-signDisplays information about an AAB file:
apk2abb-analyze output/your-app.aabYou can also use the package in your Python code:
from apk2abb import APKtoAABConverter
# Create converter instance
converter = APKtoAABConverter()
# Convert APK to AAB
converter.process_apk("path/to/your-app.apk", sign=True)from apk2abb import create_keystore
# Create a custom keystore
create_keystore(
keystore_path="my-app.keystore",
keystore_pass="my-secure-password",
alias="my-app-key",
alias_pass="my-key-password",
validity_days=25550 # ~70 years
)After installation and setup, your working directory will have:
your-project/
├── tools/ # Bundletool JAR (auto-downloaded)
├── certs/ # Your keystores
│ └── iot_marketplace_app.keystore
├── output/ # Generated AAB files
│ └── your-app.aab
└── logs/ # Operation logs
├── setup.log
├── cert.log
└── conversion.log
Note: These directories are created in your current working directory, NOT in the package installation directory.
-
Setup (one-time):
apk2abb-setup # Download bundletool apk2abb-cert # Create keystore
-
Convert (repeat as needed):
apk2abb-convert your-app.apk
-
Verify:
apk2abb-analyze output/your-app.aab
The AAB file will be created in the output/ directory and is ready for Google Play Store upload!
-
Create your own keystore:
keytool -genkey -v -keystore certs/my-app.keystore \ -keyalg RSA -keysize 2048 -validity 25550 \ -alias my-app-key
-
Update your code to use custom credentials:
from apk2abb import APKtoAABConverter converter = APKtoAABConverter() converter.keystore_path = "certs/my-app.keystore" converter.keystore_pass = "your-secure-password" converter.key_alias = "my-app-key" converter.key_pass = "your-key-password" converter.process_apk("your-app.apk")
The package uses bundletool version 1.15.6 by default. To use a different version, you can download it manually to tools/bundletool.jar.
# Check Java installation
java -version
# Install Java (Ubuntu/Debian)
sudo apt install default-jdk
# Install Java (macOS)
brew install openjdk@11
# Install Java (Windows)
# Download from https://www.oracle.com/java/technologies/downloads/# List keystore contents
keytool -list -v -keystore certs/iot_marketplace_app.keystore
# Verify with password (default: iot_app_12345)# Manually run setup again
apk2abb-setupAll operations are logged to the logs/ directory:
setup.log- Bundletool download logscert.log- Certificate operationsconversion.log- APK to AAB conversion logs
View logs in real-time:
# Windows PowerShell
Get-Content logs/conversion.log -Wait
# Linux/Mac
tail -f logs/conversion.logAfter generating your AAB file:
- Sign in to Google Play Console
- Select your app (or create a new one)
- Go to Release → Production (or Testing track)
- Click Create new release
- Upload your AAB file from the
output/directory - Complete the release details and publish
- Python 3.7 or higher
- Java 11 or higher
- Internet connection (for initial bundletool download)
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Uses Google's bundletool for AAB generation
- Built for easy Play Store deployment without Android Studio
If you encounter any issues or have questions:
- Open an issue on GitHub
- Check the logs in the
logs/directory for detailed error messages
- Initial release
- APK to AAB conversion
- Automatic bundletool download
- Keystore management
- AAB signing
- Command-line interface
- Python API
Made with ❤️ for Android developers