Over the weekend I went down a rabbit hole with OpenClaw. I wanted to see if I could turn an old Android phone into a fully capable AI‑powered IoT device for future projects. After a lot of trial, error, and caffeine, I finally documented the entire process in my GitHub repo.
I’ve just released a project that lets you install OpenClaw directly on any Android device using Termux. No root. No hacks. Just clean setup. This instantly turns an old phone or tablet into a local AI assistant, an automation brain, or even a portable IoT controller.
-
Run OpenClaw directly on the device. Perfect for smart home flows, voice assistants, offline AI tasks, and edge computing experiments.
-
GPS, camera, mic, accelerometer, battery stats, network stack. All available out of the box. Your phone becomes a sensor hub or IoT gateway without extra hardware.
-
OpenClaw keeps running even when the app is closed. Ideal for long‑running automations.
-
Turn unused phones into AI hubs, IoT controllers, automation servers, or remote monitoring nodes.
If you’re into IoT, AI, automation, or edge computing, this opens up a lot of fun possibilities.
Here, I share a collection of specialized scripts to install and manage OpenClaw on Android devices using Termux.
OpenClaw usually targets server environments, but these scripts bridge the gap for mobile hardware by fixing hardcoded paths, handling non-root service management, and applying NodeJS workarounds for the Android NDK.
For a detailed walkthrough, check out our [YouTube video] [TikToK]
Before starting, ensure you have the following:
- Termux: Downloaded from F-Droid. Do not use the Google Play version, as it is outdated and incompatible.
- Termux:API: Install the Termux:API app from F-Droid. This is required for hardware features like notifications, battery status, and clipboard access. Without this, OpenClaw's mobile features will be significantly limited.
To install everything automatically, open Termux and run:
pkg install -y git && git clone https://github.com/irtiq7/OpenClaw-Android.git ~/openclaw-android-setup && cd ~/openclaw-android-setup && chmod +x *.sh && ./setup_claw.shThis script performs a complete environment preparation and installation.
- System Prep: Installs Node.js, Git, Python, Cmake, Ninja, and Build-Essentials.
- Environment Fixes: Configures
TMPDIRandTEMPvariables to point to valid Termux directories (preventing "Permission Denied" errors). - NDK Workaround: Applies a dummy
.gypconfiguration to prevent compilation failures during native module installation. - Hardcoded Path Patch: Automatically patches the OpenClaw source code to redirect
/tmp/openclawto a Termux-accessible path. - Service Management: Sets up a persistent background service using
termux-services(runit), allowing OpenClaw to run in the background without an active terminal window.
Use this whenever a new OpenClaw version is released.
- Safely stops the background service.
- Updates OpenClaw to the latest version via npm.
- Critical: Re-applies the hardcoded path patches (which are often lost during updates).
- Restarts the service automatically.
- Install Termux: Download it from F-Droid (do not use the Play Store version).
- Run the Setup Script:
cd ~/openclaw-android-setup chmod +x *.sh ./setup_claw.sh
- Run Onboarding:
After the script finishes, run:
openclaw onboard
⚠️ IMPORTANT: When asked if you want to install a "Daemon" or "System Service", SAY NO. The script has already handled this using a method compatible with Android. - Finalize:
The
source ~/.bashrc sv up openclaw termux-wake-lock
termux-wake-lockcommand is required to keep the CPU awake so OpenClaw doesn't get killed when you minimize the app.
- Check Status:
sv status openclaw - Stop Service:
sv down openclaw - Start Service:
sv up openclaw - View Logs:
tail -f $PREFIX/var/log/openclaw/current - Web UI Access: Open your browser and go to
http://localhost:18789

