Building Termux from source gives you full control over the app binary, lets you test pull requests before they land in a release, and is required if you want to change the package name for a fork. The project uses a standard Android Gradle build; if you have used Android Studio before, most of the setup will be familiar.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/termux/termux-app/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before cloning the repository, make sure the following tools are installed and available on yourPATH.
| Requirement | Version / notes |
|---|---|
| Android Studio | Latest stable channel |
| Android NDK | 29.0.14206865 — set via ndkVersion in gradle.properties |
| JDK | Java 8 compatible (sourceCompatibility JavaVersion.VERSION_1_8 in app/build.gradle) |
| Git | Any recent version |
Android Studio bundles its own JDK. If you rely on that bundled JDK, you do not need a separate Java installation. The NDK can be installed from SDK Manager → SDK Tools → NDK (Side by side).
Project structure
The repository is a multi-module Gradle project. The modules are declared insettings.gradle:
| Module | Description |
|---|---|
:app | Main Termux application |
:terminal-emulator | Terminal emulation library (VT/xterm state machine) |
:terminal-view | Android View that renders the terminal on screen |
:termux-shared | Shared constants and utilities used by the app and all plugins |
Building
Open in Android Studio
Use File → Open and select the cloned directory. Android Studio detects the Gradle project and syncs dependencies automatically. Wait for the initial sync to finish before proceeding.
Package variants
TheTERMUX_PACKAGE_VARIANT environment variable (or the packageVariant property in app/build.gradle) controls which bootstrap is embedded in the APK. The supported values are:
| Variant | Target Android version | Notes |
|---|---|---|
apt-android-7 (default) | Android 7+ | Recommended for all modern devices; full package update support |
apt-android-5 | Android 5 and 6 | No package update support; legacy use only |
Bootstrap packages
During the Gradle build thedownloadBootstraps task automatically fetches bootstrap zip archives from the termux/termux-packages release page. The exact version and SHA-256 checksums are hardcoded in app/build.gradle.
Current bootstrap versions embedded in app/build.gradle:
- apt-android-7:
2026.02.12-r1+apt.android-7 - apt-android-5:
2022.04.28-r6+apt-android-5
app/src/main/cpp/bootstrap-<arch>.zip. Running ./gradlew clean deletes the cached zips. The bootstrap contains the minimal shell environment — bash, apt, and core utilities — needed to start a working Termux session.
APK outputs
After a successful build, APKs are written toapp/build/outputs/apk/. Debug builds go into the debug/ subdirectory; release builds into release/. The output file names follow the pattern:
Using JitPack for library development
If you only need thetermux-shared library or the terminal libraries as dependencies of another app, they are published to JitPack from the main repository. Add the JitPack repository to your project and declare the dependency:
settings.gradle
build.gradle
<version> with a release tag such as v0.118.0, a commit hash, or -SNAPSHOT for the latest master build.
For local development against a checked-out copy of
termux-app, use Gradle composite builds or local Maven publishing (./gradlew publishToMavenLocal) instead of the JitPack coordinate.