marshallrichards/ClawPhone
Scripts and Tweaks for running agents like OpenClaw, Claude Code, Codex, Hermes Agent, and more on an Android smartphone
ClawPhone provides scripts and documentation for running AI agent command-line interfaces, such as Hermes Agent and OpenClaw, natively on Android devices via Termux. The project focuses on maintaining a native environment by patching binary assumptions and using glibc wrappers rather than relying on heavy virtualization layers. It includes an automated installer for Google's Antigravity CLI and detailed configurations for integrating phone hardware through Termux:API and Termux:GUI. This setup allows users to deploy isolated agent sandboxes on mobile hardware that can interact with system functions or external platforms like Discord.
- Automated installer for Antigravity CLI on ARM64 Android devices
- Native Termux deployment avoiding heavy proot or compatibility layers
- Hardware integration support via Termux:API and Termux:GUI extensions
full readme from github
ClawPhone | AgentPhone
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.
Antigravity CLI on Termux
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 --version
Details: docs/antigravity-termux.md
OpenClaw Notes
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.