Android Builder CLI is a portable, zero-dependency-pollution command-line toolkit designed to simplify Android development. It provides an elegant Terminal UI (TUI) to compile Native Android (Java/Kotlin) APKs, manage Java Keystores (.jks), and auto-configure Android SDK environments directly from your terminal.
The CLI offers a centralized control center with the following interactive modules:
-
🚀 Build Android APK (
build)- Compiles Debug (
assembleDebug) & Release (assembleRelease) APKs. - Automatically injects AGP signing flags (
-Pandroid.injected.signing.store.file=...) for release builds. - Features dynamic SDK version parsing and remembers your last project paths for a seamless experience.
- Compiles Debug (
-
🔑 Manage Keystores & Release Keys (
keystore)- Interactive manager to generate new
.jkskeystores using the JDKkeytool. - Add multiple key aliases to existing keystores.
- Automatically records
-dnamecertificate metadata in the local configuration for future reference.
- Interactive manager to generate new
-
⚙️ Configure Environment (
env)- Easily configure and manage system paths for JDK, Android SDK, and Gradle Engine.
- Choose between your project's local Gradle Wrapper (
./gradlew) or a standalone Gradle installation.
-
🩺 Run Diagnostics (
doctor)- Performs environment health checks.
- Verifies the OpenJDK runtime, Android SDK platform packages, Google Command-Line Tools (
sdkmanager), and Gradle engine readiness.
-
🧹 Clean Cache (
clean)- Reset build outputs, clean intermediate task artifacts, and purge Gradle build caches for your selected project.
No more struggling with manual Android SDK setups! If the CLI detects missing Command-Line Tools, it triggers an automated setup sequence:
- Official Download: Fetches the official Command-Line Tools zip directly from Google's repository.
- Streamed Extraction: Downloads and extracts the archive in memory, displaying a real-time progress spinner.
- Smart Restructuring: Re-arranges the binaries into the precise directory layout required by Google's
sdkmanager.bat(./runtime/sdk/cmdline-tools/latest/). - License Automation: Automatically accepts all necessary Google SDK licenses, saving you time and hassle.
| Requirement | Supported Version | Purpose |
|---|---|---|
| Node.js | v20+ (Tested on 22) |
Execution runtime for the CLI TUI and process runner. |
| JDK | v17+ (Tested on 21) |
OpenJDK toolchain for Gradle and keytool generation. |
| OS | Windows |
Designed for Command Prompt, PowerShell, or Windows Terminal. |
-
Clone the repository:
git clone <your-repo-url> cd apkBuilderCLI
-
Install dependencies:
npm install
-
Run the CLI:
npm start
(Alternatively, you can run it via the included batch file:
.\bin\android-builder-cli.bat)
bin/: Contains the CLI entry points (index.jsand.batwrapper).src/core/: Core internal logic (Configuration, Detectors, SDK Management, Keystore Engine).src/modules/: Main CLI command modules (Build, Clean, Doctor, Env, Keystore).src/ui/: Terminal UI components (built usingclack,boxen,chalk).runtime/: Locally stored configuration, logs, and downloaded SDKs.
While the Android Builder CLI is a powerful tool for streamlining workflows, its magic is constantly being expanded.
Currently, the forge only supports:
- Native Android Projects (Kotlin/Java): The build engine is optimized specifically for standard Gradle-based native Android projects.
- Flutter support: Flutter already has its own build system, but we plan to integrate Flutter build commands into the CLI for a unified experience.
- Auto Config for ABI split: The CLI will intelligently detect and configure ABI splits for optimized APK builds.
- Project Templates: The CLI will offer predefined project templates to kickstart new Android projects quickly.
- GUI: A graphical user interface for the CLI, providing a more visual and user-friendly experience.
This project is licensed under the MIT License. Developed for portable, zero-pollution Android developer tooling.



