openclaw-droid 2.0.2 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +210 -204
- package/SECURITY.md +210 -210
- package/bin/openclawdx +7 -7
- package/install.sh +93 -57
- package/lib/bionic-bypass.js +64 -64
- package/lib/env.js +49 -49
- package/lib/index.js +25 -25
- package/lib/installer.js +300 -291
- package/lib/utils.js +117 -117
- package/overlay_daemon.py +105 -105
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,204 +1,210 @@
|
|
|
1
|
-
# OpenClaw Droid 🤖
|
|
2
|
-
|
|
3
|
-
> **Run OpenClaw AI Gateway on Android via Termux**
|
|
4
|
-
> One-command setup. Optimized for mobile. Bionic Bypass included.
|
|
5
|
-
|
|
6
|
-

|
|
7
|
-

|
|
8
|
-

|
|
9
|
-
|
|
10
|
-
**OpenClaw Droid** makes running [OpenClaw](https://github.com/openclaw/openclaw) on Android effortless. It handles environment setup (proot-distro, Ubuntu, Node.js) and fixes Android-specific issues automatically.
|
|
11
|
-
|
|
12
|
-
## 🚀 Why OpenClaw Droid?
|
|
13
|
-
|
|
14
|
-
Running standard Node.js AI tools on Android is painful because of:
|
|
15
|
-
* **Bionic libc**: Android's C library differs from Linux (glibc), breaking `os.networkInterfaces()` and DNS lookups.
|
|
16
|
-
* **Permissions**: Termux has restricted access to system resources.
|
|
17
|
-
* **Environment**: Many tools expect a full Linux userland (Ubuntu/Debian).
|
|
18
|
-
|
|
19
|
-
**OpenClaw Droid solves this by:**
|
|
20
|
-
1. Creating a lightweight **Ubuntu** container inside Termux.
|
|
21
|
-
2. Injecting a **Bionic Bypass** script to fix networking.
|
|
22
|
-
3. Providing a simple CLI (`openclaw`) to manage the gateway.
|
|
23
|
-
|
|
24
|
-
## 📦 Installation
|
|
25
|
-
|
|
26
|
-
### Prerequisites
|
|
27
|
-
* **Android 10+**
|
|
28
|
-
* **Termux** (Install from [F-Droid](https://f-droid.org/packages/com.termux/), NOT Play Store)
|
|
29
|
-
* **Termux:API** and **Termux:GUI** apps (from F-Droid)
|
|
30
|
-
* ~2GB free storage
|
|
31
|
-
|
|
32
|
-
### Required Apps Setup
|
|
33
|
-
|
|
34
|
-
1. **Install Termux** from [F-Droid](https://f-droid.org/packages/com.termux/)
|
|
35
|
-
2. **Install Termux:API** from [F-Droid](https://f-droid.org/packages/com.termux.api/)
|
|
36
|
-
3. **Install Termux:GUI** from [F-Droid](https://f-droid.org/packages/com.termux.gui/)
|
|
37
|
-
4. **Grant permissions** in Android Settings:
|
|
38
|
-
- Go to Settings → Apps → Termux → Permissions
|
|
39
|
-
- Grant all permissions (Camera, Microphone, Storage, Location, etc.)
|
|
40
|
-
- Repeat for Termux:API and Termux:GUI
|
|
41
|
-
5. **Disable battery optimization** for Termux:
|
|
42
|
-
- Go to Settings → Apps → Termux → Battery
|
|
43
|
-
- Set to "Unrestricted" or "Don't optimize"
|
|
44
|
-
6. **Grant storage permissions** in Termux:
|
|
45
|
-
```bash
|
|
46
|
-
termux-setup-storage
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
### Install Required Packages
|
|
50
|
-
|
|
51
|
-
Update package lists and install essential tools:
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
# Update package lists
|
|
55
|
-
pkg update && pkg upgrade
|
|
56
|
-
|
|
57
|
-
# Install x11-repo (required for termux-gui)
|
|
58
|
-
pkg install -y x11-repo
|
|
59
|
-
|
|
60
|
-
# Install required packages
|
|
61
|
-
pkg install -y git python nodejs-lts proot-distro termux-api termux-gui
|
|
62
|
-
|
|
63
|
-
# Verify installations
|
|
64
|
-
node --version
|
|
65
|
-
python --version
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
|
151
|
-
|
|
|
152
|
-
| `openclaw
|
|
153
|
-
| `openclaw
|
|
154
|
-
| `openclaw
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
echo 'export
|
|
176
|
-
echo '
|
|
177
|
-
|
|
178
|
-
mkdir -p
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
*
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
1
|
+
# OpenClaw Droid 🤖
|
|
2
|
+
|
|
3
|
+
> **Run OpenClaw AI Gateway on Android via Termux**
|
|
4
|
+
> One-command setup. Optimized for mobile. Bionic Bypass included.
|
|
5
|
+
|
|
6
|
+

|
|
7
|
+

|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
**OpenClaw Droid** makes running [OpenClaw](https://github.com/openclaw/openclaw) on Android effortless. It handles environment setup (proot-distro, Ubuntu, Node.js) and fixes Android-specific issues automatically.
|
|
11
|
+
|
|
12
|
+
## 🚀 Why OpenClaw Droid?
|
|
13
|
+
|
|
14
|
+
Running standard Node.js AI tools on Android is painful because of:
|
|
15
|
+
* **Bionic libc**: Android's C library differs from Linux (glibc), breaking `os.networkInterfaces()` and DNS lookups.
|
|
16
|
+
* **Permissions**: Termux has restricted access to system resources.
|
|
17
|
+
* **Environment**: Many tools expect a full Linux userland (Ubuntu/Debian).
|
|
18
|
+
|
|
19
|
+
**OpenClaw Droid solves this by:**
|
|
20
|
+
1. Creating a lightweight **Ubuntu** container inside Termux.
|
|
21
|
+
2. Injecting a **Bionic Bypass** script to fix networking.
|
|
22
|
+
3. Providing a simple CLI (`openclaw`) to manage the gateway.
|
|
23
|
+
|
|
24
|
+
## 📦 Installation
|
|
25
|
+
|
|
26
|
+
### Prerequisites
|
|
27
|
+
* **Android 10+**
|
|
28
|
+
* **Termux** (Install from [F-Droid](https://f-droid.org/packages/com.termux/), NOT Play Store)
|
|
29
|
+
* **Termux:API** and **Termux:GUI** apps (from F-Droid)
|
|
30
|
+
* ~2GB free storage
|
|
31
|
+
|
|
32
|
+
### Required Apps Setup
|
|
33
|
+
|
|
34
|
+
1. **Install Termux** from [F-Droid](https://f-droid.org/packages/com.termux/)
|
|
35
|
+
2. **Install Termux:API** from [F-Droid](https://f-droid.org/packages/com.termux.api/)
|
|
36
|
+
3. **Install Termux:GUI** from [F-Droid](https://f-droid.org/packages/com.termux.gui/)
|
|
37
|
+
4. **Grant permissions** in Android Settings:
|
|
38
|
+
- Go to Settings → Apps → Termux → Permissions
|
|
39
|
+
- Grant all permissions (Camera, Microphone, Storage, Location, etc.)
|
|
40
|
+
- Repeat for Termux:API and Termux:GUI
|
|
41
|
+
5. **Disable battery optimization** for Termux:
|
|
42
|
+
- Go to Settings → Apps → Termux → Battery
|
|
43
|
+
- Set to "Unrestricted" or "Don't optimize"
|
|
44
|
+
6. **Grant storage permissions** in Termux:
|
|
45
|
+
```bash
|
|
46
|
+
termux-setup-storage
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Install Required Packages
|
|
50
|
+
|
|
51
|
+
Update package lists and install essential tools:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Update package lists
|
|
55
|
+
pkg update && pkg upgrade
|
|
56
|
+
|
|
57
|
+
# Install x11-repo (required for termux-gui)
|
|
58
|
+
pkg install -y x11-repo
|
|
59
|
+
|
|
60
|
+
# Install required packages
|
|
61
|
+
pkg install -y git python nodejs-lts proot-distro termux-api termux-gui
|
|
62
|
+
|
|
63
|
+
# Verify installations
|
|
64
|
+
node --version
|
|
65
|
+
python --version
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
If termux-gui is unavailable, continue without it (overlay features disabled).
|
|
69
|
+
|
|
70
|
+
### One-Command Setup
|
|
71
|
+
Open Termux and run:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
curl -fsSL https://raw.githubusercontent.com/NosytLabs/openclaw-droid/main/install.sh | bash
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Or via npm:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
npm install -g openclaw-droid
|
|
81
|
+
openclaw setup
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**IMPORTANT:** Use `npm install -g openclaw@latest` installation method (not bash script) as it's more reliable on Android. The installation may take 15-30 minutes due to llama.cpp compilation from scratch.
|
|
85
|
+
|
|
86
|
+
## 🎮 Usage
|
|
87
|
+
|
|
88
|
+
### 1. Initialize
|
|
89
|
+
First, configure your API keys:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
openclaw onboarding
|
|
93
|
+
```
|
|
94
|
+
> **IMPORTANT:** Select **Loopback (127.0.0.1)** for Binding.
|
|
95
|
+
|
|
96
|
+
### 2. Start Gateway
|
|
97
|
+
Launch the OpenClaw gateway:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
openclaw start
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Recommended:** Run the gateway in a tmux session for better process management:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# Install tmux first if not installed
|
|
107
|
+
pkg install tmux
|
|
108
|
+
|
|
109
|
+
# Start a new tmux session
|
|
110
|
+
tmux new -s openclaw
|
|
111
|
+
|
|
112
|
+
# Run the gateway
|
|
113
|
+
openclaw start
|
|
114
|
+
|
|
115
|
+
# Detach from tmux (keep it running): Ctrl+B, then D
|
|
116
|
+
# Reattach to tmux session: tmux attach -t openclaw
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
The dashboard will be available at:
|
|
120
|
+
- **http://127.0.0.1:18789** (on the phone)
|
|
121
|
+
- **http://<phone-ip>:18789** (from other devices on WiFi, requires gateway.bind = lan)
|
|
122
|
+
|
|
123
|
+
### 3. Enable Screen Overlay (Optional)
|
|
124
|
+
|
|
125
|
+
To allow OpenClaw to display overlay messages on your screen:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
# In a separate tmux window or terminal:
|
|
129
|
+
tmux new-window
|
|
130
|
+
cd ~
|
|
131
|
+
python ~/overlay_daemon.py
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Or use the built-in command:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
openclaw overlay
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Now OpenClaw can write to the screen by creating `~/overlay.txt`:
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
printf 'Hello from OpenClaw!' > ~/overlay.txt
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
The overlay daemon watches for changes to `~/overlay.txt` and displays the content as a screen overlay. This is useful for displaying status updates, notifications, or important information to the user.
|
|
147
|
+
|
|
148
|
+
### 4. Other Commands
|
|
149
|
+
|
|
150
|
+
| Command | Description |
|
|
151
|
+
| :--- | :--- |
|
|
152
|
+
| `openclaw status` | Check installation health |
|
|
153
|
+
| `openclaw update` | Update OpenClaw to latest version |
|
|
154
|
+
| `openclaw shell` | Open Ubuntu shell |
|
|
155
|
+
| `openclaw repair` | Re-install dependencies if broken |
|
|
156
|
+
| `openclaw <cmd>` | Run any OpenClaw command (e.g., `openclaw doctor`) |
|
|
157
|
+
|
|
158
|
+
## ⚠️ Troubleshooting
|
|
159
|
+
|
|
160
|
+
**"Setup not complete" error**
|
|
161
|
+
* Run `openclaw setup` again.
|
|
162
|
+
* If it persists, run `openclaw repair`.
|
|
163
|
+
|
|
164
|
+
**Process killed in background**
|
|
165
|
+
* Go to Android Settings → Apps → Termux → Battery → **Unrestricted**.
|
|
166
|
+
|
|
167
|
+
**Permission denied errors**
|
|
168
|
+
* Run `termux-setup-storage` to grant storage permissions
|
|
169
|
+
* Ensure Termux:API and Termux:GUI have proper permissions
|
|
170
|
+
|
|
171
|
+
**Cannot access /tmp/openclaw errors**
|
|
172
|
+
* OpenClaw requires a custom TMPDIR on Termux. The installer should configure this automatically.
|
|
173
|
+
* If you still see these errors, manually add to `~/.bashrc`:
|
|
174
|
+
```bash
|
|
175
|
+
echo 'export TMPDIR="$PREFIX/tmp"' >> ~/.bashrc
|
|
176
|
+
echo 'export TMP="$TMPDIR"' >> ~/.bashrc
|
|
177
|
+
echo 'export TEMP="$TMPDIR"' >> ~/.bashrc
|
|
178
|
+
echo 'if [ ! -d "$TMPDIR" ]; then mkdir -p "$TMPDIR"; fi' >> ~/.bashrc
|
|
179
|
+
source ~/.bashrc
|
|
180
|
+
mkdir -p /data/data/com.termux/files/usr/tmp/openclaw
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
**"systemd not found" errors**
|
|
184
|
+
* These are normal on Android/Termux and can be safely ignored.
|
|
185
|
+
* OpenClaw will function without systemd.
|
|
186
|
+
|
|
187
|
+
**Installation fails on dependencies**
|
|
188
|
+
* Some dependencies may fail to install initially. Install them manually:
|
|
189
|
+
```bash
|
|
190
|
+
pkg install -y python git proot-distro
|
|
191
|
+
npm install -g openclaw@latest
|
|
192
|
+
```
|
|
193
|
+
* The llama.cpp compilation takes 15-30 minutes - let it complete.
|
|
194
|
+
|
|
195
|
+
**"E: unable to locate package termux-git" errors**
|
|
196
|
+
* Install Termux from F-Droid and update repositories: `pkg update && pkg upgrade`
|
|
197
|
+
* Use `pkg install git` (the Termux package name is `git`, not `termux-git`)
|
|
198
|
+
|
|
199
|
+
**"E: unable to locate package termux-gui" errors**
|
|
200
|
+
* Run `pkg install x11-repo` then retry `pkg install termux-gui`
|
|
201
|
+
* If it still fails, continue without termux-gui (overlay features disabled)
|
|
202
|
+
|
|
203
|
+
**Gateway not accessible from other devices**
|
|
204
|
+
* Ensure `gateway.bind` is set to `lan` in your openclaw.json
|
|
205
|
+
* Check your phone's IP address: `ip addr show wlan0`
|
|
206
|
+
* Access via: `http://<phone-ip>:18789`
|
|
207
|
+
|
|
208
|
+
## 📜 License
|
|
209
|
+
|
|
210
|
+
MIT License.
|