npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

universal-apk-builder

v1.0.0-beta.1

Published

CLI tool to easily convert Android App Bundle (.aab) files into universal APKs using Google bundletool

Readme

Universal APK Builder (uab / universal-apk-builder)

npm version License: MIT

A blazing fast, zero-configuration Node.js CLI & library to convert Android App Bundle (.aab) files into universal .apk files using Google's official bundletool.


⚡ Features

  • 🚀 Zero Manual Setup: Automatically downloads and caches the latest official Google bundletool JAR.
  • 📦 Simple CLI: Convert with a single command: uab app.aab or uab app.aab output.apk.
  • 💬 Interactive Mode: Run without arguments to use the interactive file picker prompts.
  • 🔑 Keystore / Signing Support: Optional flags to sign the generated universal APK directly.
  • 🛠️ Programmatic TypeScript/JavaScript API: Can be imported and used directly in Node.js scripts or CI/CD pipelines.
  • ☕ Pre-flight Checks: Validates Java runtime and provides helpful instructions if missing.

📋 Prerequisites


📦 Installation

Run directly with npx (No install needed)

npx universal-apk-builder ./app-release.aab
# or
npx uab ./app-release.aab

Global Install

npm install -g universal-apk-builder

Local Project Install

npm install --save-dev universal-apk-builder

🚀 Usage

1. Basic Usage (Positional Arguments)

# Generates ./app-release-universal.apk
uab ./app-release.aab

# Specify custom output path
uab ./app-release.aab ./build/my-universal-app.apk

2. Using Options / Flags

uab -i ./app-release.aab -o ./dist/output.apk

3. Interactive Mode

Run without arguments and follow the terminal prompts:

uab

4. Signed Universal APK

You can provide keystore credentials to sign the output APK:

uab ./app.aab ./app-signed.apk \
  --ks ./my-release-key.jks \
  --ks-pass "secretpassword" \
  --ks-key-alias "my-alias" \
  --key-pass "keypassword"

5. Overwrite Existing Files

uab ./app.aab ./output.apk --force

📖 CLI Reference

Usage: uab [options] [command] [bundle] [output]

Arguments:
  bundle                    Path to the input .aab file
  output                    Destination path or directory for the output .apk

Options:
  -v, --version             Output the current version
  -i, --input <path>        Path to the input .aab file
  -o, --output <path>       Destination path or directory for the output .apk
  -f, --force               Overwrite destination file if it already exists (default: false)
  --bundletool-path <path>  Custom path to bundletool-all.jar
  --ks <path>               Path to keystore file for signing
  --ks-pass <pass>          Keystore password
  --ks-key-alias <alias>    Key alias
  --key-pass <pass>         Key password
  -h, --help                Display help for command

Commands:
  setup-bundletool          Download or verify bundletool.jar in local cache

💻 Programmatic API (TypeScript / Node.js)

You can also use universal-apk-builder directly inside your build scripts:

import { buildUniversalApk, checkJavaEnvironment } from 'universal-apk-builder';

async function main() {
  // Check Java environment
  const java = checkJavaEnvironment();
  console.log('Java version:', java.versionString);

  // Build universal APK
  const result = await buildUniversalApk({
    bundlePath: './android/app/build/outputs/bundle/release/app-release.aab',
    outputPath: './build/universal.apk',
    force: true,
  });

  console.log(`Generated: ${result.outputPath} (${result.formattedSize}) in ${result.durationMs}ms`);
}

main().catch(console.error);

🛠️ How It Works

  1. Java Check: Verifies that Java 11+ is installed.
  2. Bundletool Resolver: Automatically downloads Google's bundletool-all.jar to ~/.universal-apk-builder/ on first run.
  3. Build APKS: Executes bundletool build-apks --bundle=<file> --output=<temp.apks> --mode=universal.
  4. Extract APK: Extracts universal.apk directly from the .apks package to your designated output path.
  5. Clean: Deletes temporary files and returns the output path and file size.

👨‍💻 Author

Vivek Kushwaha


📄 License

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