Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Android Builder CLI

License: MIT Node.js Java SDK Android Studio

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.

✨ Key Features

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.
  • 🔑 Manage Keystores & Release Keys (keystore)

    • Interactive manager to generate new .jks keystores using the JDK keytool.
    • Add multiple key aliases to existing keystores.
    • Automatically records -dname certificate metadata in the local configuration for future reference.
  • ⚙️ 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.

🛠️ Automated SDK Management

No more struggling with manual Android SDK setups! If the CLI detects missing Command-Line Tools, it triggers an automated setup sequence:

  1. Official Download: Fetches the official Command-Line Tools zip directly from Google's repository.
  2. Streamed Extraction: Downloads and extracts the archive in memory, displaying a real-time progress spinner.
  3. Smart Restructuring: Re-arranges the binaries into the precise directory layout required by Google's sdkmanager.bat (./runtime/sdk/cmdline-tools/latest/).
  4. License Automation: Automatically accepts all necessary Google SDK licenses, saving you time and hassle.

📋 Prerequisites

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.

🚀 Installation & Quick Start

  1. Clone the repository:

    git clone <your-repo-url>
    cd apkBuilderCLI
  2. Install dependencies:

    npm install
  3. Run the CLI:

    npm start

    (Alternatively, you can run it via the included batch file: .\bin\android-builder-cli.bat)

🏗️ Project Structure

  • bin/: Contains the CLI entry points (index.js and .bat wrapper).
  • 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 using clack, boxen, chalk).
  • runtime/: Locally stored configuration, logs, and downloaded SDKs.

🚧 Current Limitations & Future Horizons

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.

🧭Future Plans:

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

📸 Screenshots

Main Control Center

Main Menu

Build Pipeline Demo

Build Step 1 Build Step 2 Build Step 3


📄 License

This project is licensed under the MIT License. Developed for portable, zero-pollution Android developer tooling.

About

Build native andriod project in TUI to avoid RAM eater or Andriod Studio IDE.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages