Skip to content

A lightweight Android build toolkit for Termux that bundles aapt2, javac, kotlinc, and d8 to compile and sign APKs without Android Studio.

License

Notifications You must be signed in to change notification settings

silvadev13/ApkBuilder

Repository files navigation

ApkBuilder

ApkBuilder is a lightweight Android build tool designed for Termux.
It bundles essential Android build utilities to compile and package APKs without Android Studio or Gradle.

This project is focused on simplicity and portability, allowing Android apps to be built directly from the command line on Android devices.


Features

  • APK Compilation
  • AAB Support
  • Java
  • Kotlin
  • R8 / ProGuard
  • ViewBinding
  • Jetpack Compose (not supported yet)

Project Structure

Your Android project must follow this structure:

Project/
 └── app/
     ├── libs/ (project libraries)
     └── src/
         └── main/
             ├── assets/        (optional)
             ├── jniLibs/       (optional)
             ├── java/          (Java/Kotlin source files)
             ├── res/           (resources)
             └── AndroidManifest.xml

Requirements (Android / Termux)

Before using ApkBuilder, make sure you have the following installed in Termux:

• OpenJDK 17

• Kotlin compiler (kotlinc)

• AAPT2

• D8

• apksigner

pkg install -y openjdk-17 kotlinc aapt2 d8 apksigner

Building an APK

To compile your project, use the builder.py module:

python builder.py <PROJECT_PATH> --min-sdk <MIN_SDK> --target-sdk <TARGET_SDK> --version-code <VERSION_CODE> --version-name <VERSION_NAME> --view-binding <ENABLE_VIEW_BINDING>

Example

python builder.py example_project/ --min-sdk 21 --target-sdk 34 --version-code 1 --version-name "1.0" --view-binding True

This will compile the project, generate DEX files, package resources, and produce a signed APK.


About

A lightweight Android build toolkit for Termux that bundles aapt2, javac, kotlinc, and d8 to compile and sign APKs without Android Studio.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published