Skip to main content

APK to AAB Converter

PyPI version Python Support License: MIT

Convert your Android APK files to Android App Bundle (AAB) format for Google Play Store deployment.

Overview

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.

Features

  • ✅ 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

Prerequisites

  • 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)

Installation

Install from PyPI:

pip install apk2abb

Or install from source:

git clone https://github.com/nithin434/apk2abb.git
cd apk2abb
pip install -e .

Quick Start

1. Initial Setup

After installation, set up the required tools:

# Download bundletool
apk2abb-setup

# Create a keystore for signing
apk2abb-cert

This will create the following directories in your current working directory:

  • tools/ - Bundletool and other required tools
  • certs/ - Your keystores and certificates
  • logs/ - Log files from operations
  • output/ - Generated AAB files

2. Convert APK to AAB

apk2abb-convert path/to/your-app.apk

That's it! Your AAB file will be created in the output/ directory.

3. Analyze AAB File

apk2abb-analyze output/your-app.aab

Usage

Command Line Interface

The package provides four command-line tools:

apk2abb-setup

Downloads and configures Google's bundletool:

apk2abb-setup

apk2abb-cert

Creates and manages keystores for signing:

apk2abb-cert

Important: Change the default passwords in production! Edit the keystore credentials in certs/iot_marketplace_app.keystore.

apk2abb-convert

Converts APK to AAB and signs it:

# Convert and sign
apk2abb-convert your-app.apk

# Convert without signing
apk2abb-convert your-app.apk --no-sign

apk2abb-analyze

Displays information about an AAB file:

apk2abb-analyze output/your-app.aab

Python API

You 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
)

Directory Structure

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.

Workflow

  1. Setup (one-time):

    apk2abb-setup     # Download bundletool
    apk2abb-cert      # Create keystore
    
  2. Convert (repeat as needed):

    apk2abb-convert your-app.apk
    
  3. 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!

Configuration

Keystore Credentials

⚠️ Security Warning: The default keystore uses demo credentials. For production:

  1. Create your own keystore:

    keytool -genkey -v -keystore certs/my-app.keystore \
      -keyalg RSA -keysize 2048 -validity 25550 \
      -alias my-app-key
    
  2. 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")
    

Bundletool Version

The package uses bundletool version 1.15.6 by default. To use a different version, you can download it manually to tools/bundletool.jar.

Troubleshooting

Java not found

# 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/

Keystore issues

# List keystore contents
keytool -list -v -keystore certs/iot_marketplace_app.keystore

# Verify with password (default: iot_app_12345)

Bundletool not downloaded

# Manually run setup again
apk2abb-setup

Logs

All operations are logged to the logs/ directory:

  • setup.log - Bundletool download logs
  • cert.log - Certificate operations
  • conversion.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.log

Play Store Deployment

After generating your AAB file:

  1. Sign in to Google Play Console
  2. Select your app (or create a new one)
  3. Go to Release → Production (or Testing track)
  4. Click Create new release
  5. Upload your AAB file from the output/ directory
  6. Complete the release details and publish

Requirements

  • Python 3.7 or higher
  • Java 11 or higher
  • Internet connection (for initial bundletool download)

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Uses Google's bundletool for AAB generation
  • Built for easy Play Store deployment without Android Studio

Support

If you encounter any issues or have questions:

  • Open an issue on GitHub
  • Check the logs in the logs/ directory for detailed error messages

Changelog

Version 0.1.0 (2026-02-15)

  • Initial release
  • APK to AAB conversion
  • Automatic bundletool download
  • Keystore management
  • AAB signing
  • Command-line interface
  • Python API

Made with ❤️ for Android developers

Metadata

Release files for apk2abb 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for apk2abb 0.1.0
File Size Uploaded
apk2abb-0.1.0.tar.gz 21.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for apk2abb 0.1.0
File Interpreter ABI Platform
apk2abb-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 33.9 kB

Release files / apk2abb-0.1.0.tar.gz

Download URL apk2abb-0.1.0.tar.gz
Size 21.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e56500b0f930d1ac999ee472164f3a84dcc6a936a2d2727858242fed698c33d9
BLAKE2b-256 checksum
How to use checksums
834062c296df5f7b7a5fb8895eef706695ea5273bb967c0b5069195e15bb847a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 15, 2026.

Transparency log

Release files / apk2abb-0.1.0-py3-none-any.whl

Download URL apk2abb-0.1.0-py3-none-any.whl
Size 12.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a886ead0f9fdb287b85ef32985877b5a3d4b51d631ba0c6f7a362e288f9b4003
BLAKE2b-256 checksum
How to use checksums
769c0b9efdbdddc094a455bbccf578e9e40204bd9e2e0055997afa68a9af67f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 15, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page