Scripts, tweaks, and notes for running agent CLIs on Android phones through Termux.
The goal is to keep things as native to Termux as possible, only using proot or heavier compatibility layers when Android's userspace makes that unavoidable.
The first packaged script is an installer for Google's Antigravity CLI (agy) on ARM64 Android/Termux. It installs/checks dependencies, installs the official Linux ARM64 binary, patches the TCMalloc VA assumptions for common Android devices, creates a glibc wrapper, adds shell shortcuts, and supports uninstall.
Shoutout to Brajesh for figuring out and sharing the original working Termux setup this is based on. This repo turns those steps into one script so it is easier for people to install, update, and uninstall.
curl -fsSL https://raw.githubusercontent.com/marshallrichards/ClawPhone/main/scripts/install-antigravity-termux.sh | bash
source ~/.bashrc
agy --versionDetails: docs/antigravity-termux.md
I started running OpenClaw on a cheap Android smartphone as an isolated sandbox for OpenClaw agents with access to phone hardware. It runs in the background inside Termux in a tmux session, and I can interact with it over Discord like a normal OpenClaw agent.
You can use a cheap prepaid Android phone or any old Android 8+ phone you have lying around.
Things to note:
- Install Termux. I recommend
tmux, a text editor likenvim,nodejs-lts, andpython. Also install Termux:API and Termux:GUI if you want hardware and UI access. - Install OpenClaw with
npm install -g openclaw@latest, not the bash installer, since the bash installer can fail on Android. - If dependencies fail during install, install the missing packages with
pkgand rerun the OpenClaw install. llama.cppmay compile from source because Termux lacks normal desktop glibc behavior. This can take 15-30 minutes.- Errors about missing
systemdare expected. Run the OpenClaw Gateway in the foreground or insidetmux. - OpenClaw expects
/tmp/openclaw, but raw Termux should use$PREFIX/tmp. Add this to~/.bashrc:
export TMPDIR="$PREFIX/tmp"
export TMP="$TMPDIR"
export TEMP="$TMPDIR"- Add Termux-friendly logging to
openclaw.json:
"logging": {
"level": "info",
"file": "/data/data/com.termux/files/usr/tmp/openclaw/openclaw-YYYY-MM-DD.log"
}- Create the temp directory:
mkdir -p /data/data/com.termux/files/usr/tmp/openclaw- Run
source ~/.bashrc, thenopenclaw gateway. - Run
openclaw onboardand add your model token. - Set
gateway.bindtolanso the dashboard listens on0.0.0.0and can be reached from the phone's LAN IP. - Tell OpenClaw it is running inside Termux on Android, and that Termux:API and Termux:GUI are installed if you want it to use phone hardware.
You can also let OpenClaw write overlays on the screen. Install the Termux:GUI app, run pkg install termux-gui, start overlay_daemon.py in another tmux pane/window, and tell OpenClaw it can use that daemon when it needs to display something to the user.