Running OpenClaw and Codex CLI Natively on Android via AnyClaw APK

AnyClaw is an APK that bundles OpenClaw and the Codex CLI inside an embedded Linux environment for Android. After installation and a one-time OpenAI OAuth authentication, the gateway and Control UI run locally on the device.
Technical Implementation Challenges
The setup involved significant challenges due to Android's environment:
- Native FFI: OpenClaw depends on koffi, which lacks prebuilt Android binaries. The solution required downloading approximately 20 Termux packages (clang, cmake, make, lld, NDK sysroot) and building koffi from source directly on the phone.
- Binary Patching: The make and cmake binaries had hardcoded Termux paths in their ELF headers, necessitating binary patching before execution.
- Gateway Crashes: On Xiaomi devices, the gateway crashed due to homebridge/ciao (the mDNS library) throwing an AssertionError for Android's ccmni cellular interfaces. OpenClaw's unhandledRejection handler calls
process.exit(1)on unrecognized errors. The fix involved patching the minifiedrunner-*.jsto catch errors containing "interface" and log them as warnings instead of exiting. - Device Identity: The Control UI generates tokens via subtle, which Chrome on Android only exposes in secure contexts (HTTPS or localhost). Using
http://127.0.0.1for the gateway URL silently broke functionality. Switching tohttp://localhostfixed the client side. Additionally,evaluateMissingDeviceIdentity()ingateway-cli-*.jswas patched to allow bypass whendangerouslyDisableDeviceAuthis set, as token negotiation failed on fresh installs across different devices. - DNS Resolution: The Codex native binary is statically linked with musl and cannot resolve hostnames on Android due to the absence of
/etc/resolv.conf. A Node.js CONNECT proxy bridges this gap, leveraging Node.js's native use of Android's Bionic resolver. - Bionic Compatibility Shim: A
bionic-compat.jsshim patchesprocess.platformfrom 'android' to 'linux', fixesos.cpus()to handle Android's different/proc/cpuinfoformat, and wrapsos.networkInterfaces()to return a fake loopback when Android's interfaces throw errors.
Configuration and Usage
- The gateway runs on port 18789, the Control UI on 19001, and the codex-web-local frontend on 18923, all within the app's private storage.
- Authentication uses the existing Codex OAuth token; the
access_tokenfrom~/.codex/auth.jsonis written intoauth-profiles.jsonas anopenai-codex:codex-cliprofile. - The default model is
openai-codex/gpt-5.3-codex. - It works on any ARM64 Android 7.0+ device without requiring root access.
This project is useful for developers who want to run OpenClaw and Codex CLI directly on Android devices for local AI coding agent workflows.
📖 Read the full source: r/openclaw
👀 See Also

OpenClaw skill reduces accessibility tree tokens from 600K to 1.3K for ad-heavy sites
A developer built an OpenClaw skill that uses ML-based element ranking to prune accessibility trees, cutting slickdeals.com from ~598K tokens to ~1.3K tokens by keeping only the top ~50 actionable elements.

Solo Dev Uses Claude + Blender MCP to Create App Store Video in 90 Minutes
Reddit user Positive_Camel2086 details how they used Claude with the Blender MCP server to generate a 10-second vertical launch video, automating camera rigging, materials, fog, and particle systems via conversational prompts.
Mesh LLM: Distributed AI Computing on Iroh – Run LLMs Across Your Own GPUs
Mesh LLM pools GPUs you already have across machines and exposes them as one OpenAI-compatible API. Distributes models locally, via peer routing, or as a pipeline across several nodes using iroh's QUIC transport.

Claude IDE Bridge: Open-source tool gives Claude AI direct access to your code editor
Claude IDE Bridge is an open-source, MIT-licensed tool that connects Claude AI directly to your code editor, allowing it to view open files, unsaved changes, and errors live rather than through pasted code snippets. The tool currently works with VS Code and Windsurf.