First confirmed native zeroclaw build on Android/Termux.
No proot. No emulation. No compromise. Pure aarch64.
This repo documents and delivers the first successful compilation of zeroclaw on Android using Termux — built natively on aarch64-unknown-linux-android, without any Linux container, proot environment, or cross-compilation trickery.
The binary runs directly in Termux. That's it. That's the flex.
Build completed: Wed Feb 25 04:11:47 CST 2026
Device arch: aarch64
Kernel: Linux 5.4.284-moto
Node: v24.13.0 | Rust/Cargo: via Termux
Build time: 23m 55s
Binary size: 15.5MB
Three things conspire against you on Termux:
- The linker is a memory hog. Android kills processes that spike RAM during the final link stage. zeroclaw's dependency tree is large enough to trigger this reliably.
make -jwithout a number dies. Termux'smakeis stricter than desktop GNU make — koffi's build script passes-jbare, which errors out onaarch64-unknown-linux-android.- No swap. Android blocks
swaponfor unprivileged processes, so you can't just throw a swapfile at the RAM problem the normal way.
The fix wasn't one thing — it was three things at once.
pkg update && pkg upgrade
pkg install clang cmake make python nodejs-lts rust binutils-cross mold gitgit clone https://github.com/zeroclaw-labs/zeroclaw.git
cd zeroclawThis is the critical step. Create .cargo/config.toml inside the zeroclaw directory:
mkdir -p .cargo && cat > .cargo/config.toml << 'EOF'
[target.aarch64-linux-android]
linker = "clang"
rustflags = ["-C", "link-arg=-fuse-ld=mold"]
[profile.release]
codegen-units = 1
opt-level = "z"
lto = "thin"
EOFWhat each flag does:
mold— replaces the default linker with one that uses a fraction of the RAMcodegen-units = 1— serializes compilation, reduces peak memory usageopt-level = "z"— optimize for size, not speed (lighter on RAM during compile)lto = "thin"— link-time optimization without the full memory cost oflto = true
cargo build --release 2>&1 | tee build_log.txtDrop --locked if you hit dependency resolution errors. Watch the output — it will compile 412 crates and take 20-30 minutes on most Android hardware. The last step (linking zeroclaw itself) is the longest and will appear to hang. It is not hung. Let it finish.
date && ls -la target/release/zeroclaw
./target/release/zeroclaw --versionA prebuilt binary for aarch64-android is included in this repo at bin/zeroclaw.
chmod +x bin/zeroclaw
./bin/zeroclaw --versionBuilt on a Motorola device running kernel 5.4.284-moto. Should run on any aarch64 Android device with Termux.
In the interest of saving you the same pain:
npm install -g openclaw— fails because koffi passesmake -jwith no number; Termux make rejects itcargo build --release --lockedwithout the cargo config — terminal crashes during link step (OOM)swapon— blocked by Android for unprivileged users, don't botherwait <pid>to monitor the build — also kills the terminal on some Android versions- Gemini CLI — tried. Failed.
- Gemini Android app — tried. Failed.
MIT — see LICENSE
See LORE.md. There's something hidden in there. Find it.
Built by @BleakNarratives with an assist from Claude.
If this helped you, star the repo. If it didn't work, open an issue.
https://ko-fi.com/bleaknarratives