This repo installs a full Flutter SDK checkout for Termux-style Android shells and overlays it with Android-bionic host tools built from the Flutter engine.
It pulls the host bundle from:
https://github.com/sirvkrm/flutter-android-bionic-builder
It pulls Android-bionic Dart SDK mirror zips from:
https://github.com/sirvkrm/dart-android-bionic-builder
The host bundle provides the pieces the stock Flutter SDK does not ship for Android-hosted terminals:
bin/cache/dart-sdkbuilt for Android bionic host arch (arm64orx64)bin/cache/artifacts/engine/linux-<host-arch>/font-subsetbin/cache/artifacts/engine/linux-<host-arch>/const_finder.dart.snapshotbin/cache/artifacts/engine/android-*-{profile,release}/android-<host-arch>/gen_snapshot
The installer patches flutter_tools so Android-hosted Termux uses the
android-<host-arch> Android snapshot tool cache namespace instead of linux-x64.
It also sets FLUTTER_TERMUX_ARTIFACT_BASE_URL in env.sh, so Android-host
snapshot zips can be fetched from this project's GitHub releases if missing.
It also sets FLUTTER_TERMUX_DART_ARTIFACT_BASE_URL in env.sh, so Android
hosts fetch Dart SDK zips from the Dart mirror repo (same release tag as the
installed host bundle) instead of Flutter's Google-hosted Linux Dart zip.
The patch set uses engine.stamp to select engine-matched mirror assets for
dart-sdk, flutter_patched_sdk(_product), and linux-<host-arch> host tools.
The patch set also whitelists this base URL in Flutter's artifact downloader,
so custom mirror downloads do not emit SDK-bug warnings.
The installer also applies a small Flutter framework patch so the tool treats Termux as a Linux-like host for host-platform selection and Android SDK path discovery.
By default, ./install.sh:
- clones the latest Flutter tag that still targets Dart
3.7(3.32.8) if it is not already present - downloads the latest Termux host bundle release asset
- extracts the bundle
- applies the Termux host compatibility patch
- auto-reclones the Flutter checkout if a previous local patch state is incompatible with the current patch set
- clears stale
bin/cache/artifacts/engine/common,linux-arm64, andlinux-x64cache directories before overlaying - overlays the bionic host tools into the Flutter SDK cache
- normalizes the overlaid Dart SDK semver so
pubaccepts the prebuilt bundle - writes
env.sh - writes a
flutter-termuxwrapper inbin/ - configures engine-stamp keyed Dart mirror env vars to avoid kernel format skew
Current validated host bundle targets:
arm64Android / Termux hostsx64Android / Termux hosts
This is aimed at running the Flutter tool itself inside Termux. Android target runtime artifacts still come from the normal Flutter cache flow (flutter precache --android or first use).
The installer itself needs:
gittarpython3unzip
On Termux it can install missing prerequisites automatically with pkg.
For actual Flutter app builds you still need the normal platform dependencies:
- Android APK builds:
- Java/JDK
- Android SDK command-line tools or Android Studio
- accepted Android licenses
- Web builds:
- Flutter web artifacts (
flutter precache --web) - a browser for local debug if you want
flutter run -d chrome
- Flutter web artifacts (
git clone https://github.com/sirvkrm/flutter-android-bionic-termux-installer.git
cd flutter-android-bionic-termux-installer
chmod +x install.sh
./install.shDefault install root on Termux:
$PREFIX/opt/flutter-termuxThat produces:
flutter/for the Flutter SDK checkoutenv.shbin/flutter-termux
Install a specific tag:
./install.sh --tag v2026.03.04Choose an asset interactively:
./install.sh --tag v2026.03.04 --interactiveInstall a specific host bundle asset:
./install.sh --tag v2026.03.04 --asset flutter-android-bionic-termux-host-x64-20260304.tar.gzList release tags:
./install.sh --list-releasesUse a different install root:
./install.sh --install-root "$HOME/my-flutter-termux"Reuse or target a different Flutter checkout path:
./install.sh --flutter-dir "$HOME/flutter-termux-sdk"If an existing checkout is present at a different Flutter ref, the installer now
replaces it automatically. Use --reclone if you want to force a fresh clone
even when the checkout already matches the requested ref.
Clone a different Flutter ref:
./install.sh --flutter-ref masterThe default ref is intentionally pinned to 3.32.8, because the current public
engine source used to build the bionic host bundle still provides Dart 3.7.
Newer Flutter framework refs such as current stable require newer Dart SDK
versions and will fail during flutter_tools bootstrap with this host bundle.
Override Dart mirror owner/repo:
./install.sh --dart-owner sirvkrm --dart-repo dart-android-bionic-builderRun Android precache immediately after install:
./install.sh --precacheLoad the environment:
source "$PREFIX/opt/flutter-termux/env.sh"Or use the wrapper directly:
$PREFIX/opt/flutter-termux/bin/flutter-termux --versionRecommended first checks:
flutter --version
flutter doctor -v
flutter precache --androidIf your Android SDK was not auto-detected, set these in env.sh:
export ANDROID_HOME="$HOME/Android/Sdk"
export ANDROID_SDK_ROOT="$HOME/Android/Sdk"Engine-stamp specific mirror variables written by installer:
export FLUTTER_TERMUX_ENGINE_STAMP="..."
export FLUTTER_TERMUX_HOST_ARCH="arm64|x64"
export FLUTTER_TERMUX_ARTIFACT_BASE_URL="https://github.com/sirvkrm/flutter-android-bionic-builder/releases/download/<tag>"
export FLUTTER_TERMUX_DART_ARTIFACT_BASE_URL="https://github.com/sirvkrm/dart-android-bionic-builder/releases/download/<tag>"
export FLUTTER_TERMUX_DART_SDK_ASSET="dart-sdk-android-<host-arch>-<engine-stamp>.zip"If your NDK is installed in Termux build-tools, also set:
export ANDROID_NDK_HOME="$HOME/.build-tools/android/android-ndk-r27c"The Flutter framework patches applied during install are stored here:
patches/0001-termux-android-host-support.patchpatches/0002-termux-android-flutter-cache-support.patchpatches/0003-termux-android-web-chrome-support.patchpatches/0004-termux-android-adb-discovery-tolerance.patchpatches/0005-termux-android-artifact-namespace-and-mirror.patchpatches/0006-termux-android-allow-custom-artifact-base-url.patchpatches/0007-termux-android-dart-sdk-mirror.patchpatches/0008-termux-android-gradle-wrapper-shell.patch
- Host bundles are published per host arch (
arm64andx64). - This installer patches the Flutter framework checkout locally; if you switch branches or reset the SDK repo, re-run the installer.
- The builder repo must publish
flutter-android-bionic-termux-host-<host-arch>-*.tar.gzfor the selected release tag.