claude-in-mobile 3.6.0 → 3.8.0

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.
Files changed (116) hide show
  1. package/README.md +391 -263
  2. package/dist/adapters/android-adapter.d.ts.map +1 -1
  3. package/dist/adapters/android-adapter.js +8 -1
  4. package/dist/adapters/android-adapter.js.map +1 -1
  5. package/dist/adapters/desktop-adapter.d.ts +8 -3
  6. package/dist/adapters/desktop-adapter.d.ts.map +1 -1
  7. package/dist/adapters/desktop-adapter.js +24 -2
  8. package/dist/adapters/desktop-adapter.js.map +1 -1
  9. package/dist/adapters/ios-adapter.d.ts.map +1 -1
  10. package/dist/adapters/ios-adapter.js +6 -3
  11. package/dist/adapters/ios-adapter.js.map +1 -1
  12. package/dist/adapters/platform-adapter.d.ts +1 -1
  13. package/dist/adapters/platform-adapter.d.ts.map +1 -1
  14. package/dist/adb/client.d.ts.map +1 -1
  15. package/dist/adb/client.js +12 -6
  16. package/dist/adb/client.js.map +1 -1
  17. package/dist/adb/resolver.d.ts +24 -0
  18. package/dist/adb/resolver.d.ts.map +1 -0
  19. package/dist/adb/resolver.js +130 -0
  20. package/dist/adb/resolver.js.map +1 -0
  21. package/dist/adb/ui-parser.d.ts +2 -0
  22. package/dist/adb/ui-parser.d.ts.map +1 -1
  23. package/dist/adb/ui-parser.js +36 -0
  24. package/dist/adb/ui-parser.js.map +1 -1
  25. package/dist/browser/client.d.ts.map +1 -1
  26. package/dist/browser/client.js +25 -7
  27. package/dist/browser/client.js.map +1 -1
  28. package/dist/browser/types.d.ts +2 -0
  29. package/dist/browser/types.d.ts.map +1 -1
  30. package/dist/browser/types.js.map +1 -1
  31. package/dist/desktop/client.d.ts +17 -6
  32. package/dist/desktop/client.d.ts.map +1 -1
  33. package/dist/desktop/client.js +338 -44
  34. package/dist/desktop/client.js.map +1 -1
  35. package/dist/desktop/gradle.d.ts +2 -2
  36. package/dist/desktop/gradle.d.ts.map +1 -1
  37. package/dist/desktop/gradle.js.map +1 -1
  38. package/dist/desktop/index.d.ts +1 -1
  39. package/dist/desktop/index.d.ts.map +1 -1
  40. package/dist/desktop/index.js +1 -1
  41. package/dist/desktop/index.js.map +1 -1
  42. package/dist/desktop/types.d.ts +29 -1
  43. package/dist/desktop/types.d.ts.map +1 -1
  44. package/dist/device-manager.d.ts +15 -3
  45. package/dist/device-manager.d.ts.map +1 -1
  46. package/dist/device-manager.js +35 -7
  47. package/dist/device-manager.js.map +1 -1
  48. package/dist/errors.d.ts +12 -1
  49. package/dist/errors.d.ts.map +1 -1
  50. package/dist/errors.js +35 -3
  51. package/dist/errors.js.map +1 -1
  52. package/dist/index.js +109 -36
  53. package/dist/index.js.map +1 -1
  54. package/dist/ios/client.d.ts +6 -2
  55. package/dist/ios/client.d.ts.map +1 -1
  56. package/dist/ios/client.js +25 -5
  57. package/dist/ios/client.js.map +1 -1
  58. package/dist/ios/wda/wda-client.d.ts +1 -0
  59. package/dist/ios/wda/wda-client.d.ts.map +1 -1
  60. package/dist/ios/wda/wda-client.js +25 -0
  61. package/dist/ios/wda/wda-client.js.map +1 -1
  62. package/dist/profiles.d.ts +33 -0
  63. package/dist/profiles.d.ts.map +1 -0
  64. package/dist/profiles.js +69 -0
  65. package/dist/profiles.js.map +1 -0
  66. package/dist/store/google-play.d.ts.map +1 -1
  67. package/dist/store/google-play.js +0 -1
  68. package/dist/store/google-play.js.map +1 -1
  69. package/dist/tools/app-tools.js +1 -1
  70. package/dist/tools/app-tools.js.map +1 -1
  71. package/dist/tools/context/shared-state.d.ts +1 -0
  72. package/dist/tools/context/shared-state.d.ts.map +1 -1
  73. package/dist/tools/context/shared-state.js +11 -0
  74. package/dist/tools/context/shared-state.js.map +1 -1
  75. package/dist/tools/context.d.ts +2 -1
  76. package/dist/tools/context.d.ts.map +1 -1
  77. package/dist/tools/context.js +3 -2
  78. package/dist/tools/context.js.map +1 -1
  79. package/dist/tools/desktop-tools.d.ts.map +1 -1
  80. package/dist/tools/desktop-tools.js +50 -5
  81. package/dist/tools/desktop-tools.js.map +1 -1
  82. package/dist/tools/flow-tools.d.ts.map +1 -1
  83. package/dist/tools/flow-tools.js +31 -5
  84. package/dist/tools/flow-tools.js.map +1 -1
  85. package/dist/tools/helpers/resolve-element.d.ts +2 -0
  86. package/dist/tools/helpers/resolve-element.d.ts.map +1 -1
  87. package/dist/tools/helpers/resolve-element.js +13 -2
  88. package/dist/tools/helpers/resolve-element.js.map +1 -1
  89. package/dist/tools/interaction-tools.d.ts.map +1 -1
  90. package/dist/tools/interaction-tools.js +35 -4
  91. package/dist/tools/interaction-tools.js.map +1 -1
  92. package/dist/tools/meta/desktop-meta.d.ts.map +1 -1
  93. package/dist/tools/meta/desktop-meta.js +8 -4
  94. package/dist/tools/meta/desktop-meta.js.map +1 -1
  95. package/dist/tools/meta/device-meta.d.ts.map +1 -1
  96. package/dist/tools/meta/device-meta.js +94 -15
  97. package/dist/tools/meta/device-meta.js.map +1 -1
  98. package/dist/tools/meta/ui-meta.d.ts.map +1 -1
  99. package/dist/tools/meta/ui-meta.js +6 -0
  100. package/dist/tools/meta/ui-meta.js.map +1 -1
  101. package/dist/tools/registry.d.ts +18 -5
  102. package/dist/tools/registry.d.ts.map +1 -1
  103. package/dist/tools/registry.js +78 -7
  104. package/dist/tools/registry.js.map +1 -1
  105. package/dist/tools/ui-tools.d.ts.map +1 -1
  106. package/dist/tools/ui-tools.js +10 -7
  107. package/dist/tools/ui-tools.js.map +1 -1
  108. package/dist/utils/anti-patterns.d.ts +11 -0
  109. package/dist/utils/anti-patterns.d.ts.map +1 -0
  110. package/dist/utils/anti-patterns.js +82 -0
  111. package/dist/utils/anti-patterns.js.map +1 -0
  112. package/dist/utils/sanitize.d.ts +1 -0
  113. package/dist/utils/sanitize.d.ts.map +1 -1
  114. package/dist/utils/sanitize.js +13 -0
  115. package/dist/utils/sanitize.js.map +1 -1
  116. package/package.json +1 -1
package/README.md CHANGED
@@ -1,54 +1,124 @@
1
1
  # Claude Mobile
2
2
 
3
- MCP server for mobile and desktop automation — Android (via ADB), iOS Simulator (via simctl), Desktop (Compose Multiplatform), and Aurora OS (via audb). Like [Claude in Chrome](https://www.anthropic.com/news/claude-for-chrome) but for mobile devices and desktop apps.
4
-
5
- Control your Android phone, emulator, iOS Simulator, Desktop applications, or Aurora OS device with natural language through Claude.
6
-
7
- ## Features
8
-
9
- - **Unified API** — Same commands work for Android, iOS, Desktop, Aurora OS, and Browser
10
- - **Token-optimized** — 8 meta-tools + 3 optional modules instead of 81 separate tools (~85% token reduction per request)
11
- - **Dynamic modules** — Browser, Desktop, and Store modules load on demand, keeping the default tool list lean
12
- - **Browser automation** Control Chrome/Chromium via CDP: navigate, click, fill forms, evaluate JS, take screenshots
13
- - **Smart screenshots** — Auto-compressed for optimal LLM processing
14
- - **Annotated screenshots** — Screenshots with colored bounding boxes and numbered element labels
15
- - **Security hardened** — Shell injection protection, URL scheme validation, path traversal blocking, input sanitization
16
- - **Structured errors** — Typed error codes (`[CODE] message`) with auto-retry hints for transient failures
17
- - **Telemetry** — Per-tool call metrics (count, avg latency, error rate) via `system(action:'metrics')`
18
- - **Multi-device parallel** — Run the same action on multiple devices simultaneously via `flow_parallel`
19
- - **Flow engine** `flow_batch` for sequential commands, `flow_run` for conditional loops, `flow_parallel` for fan-out
20
- - **Permission management** Grant, revoke, and reset app permissions (Android runtime, iOS privacy services)
21
- - **Store management** — Upload builds to Google Play, Huawei AppGallery, and RuStore (optional module)
22
- - **Desktop support** — Test Compose Multiplatform desktop apps with window management, clipboard, and performance metrics
3
+ MCP server for mobile, desktop, and browser automation — Android (ADB), iOS Simulator (simctl + WDA), Desktop (any macOS app), Aurora OS (audb), and Browser (CDP). Like [Claude in Chrome](https://www.anthropic.com/news/claude-for-chrome) but for devices, apps, and browsers.
4
+
5
+ Control your Android phone, emulator, iOS Simulator, desktop app, Aurora device, or headless browser with natural language through Claude.
6
+
7
+ ---
8
+
9
+ ## Table of Contents
10
+
11
+ - [Quick Start](#quick-start)
12
+ - [Features at a Glance](#features-at-a-glance)
13
+ - [Quality Engineering](#quality-engineering)
14
+ - [Installation](#installation)
15
+ - [Homebrew (macOS)](#homebrew-macos)
16
+ - [One-liner (any client)](#one-liner-any-client)
17
+ - [Claude Code](#claude-code)
18
+ - [OpenCode](#opencode)
19
+ - [Other Agents (Pi, Qwen, Gemini, Codex, Cursor)](#other-agents)
20
+ - [From npm / source](#from-npm--source)
21
+ - [Windows](#windows)
22
+ - [Platform Guides](#platform-guides)
23
+ - [Android](#android)
24
+ - [iOS](#ios)
25
+ - [Desktop](#desktop)
26
+ - [Browser](#browser)
27
+ - [Aurora OS](#aurora-os)
28
+ - [Tools Reference](#tools-reference)
29
+ - [Core Meta-Tools](#core-meta-tools)
30
+ - [Optional Modules](#optional-modules)
31
+ - [Flow Tools](#flow-tools)
32
+ - [Native CLI](#native-cli)
33
+ - [Architecture](#architecture)
34
+ - [License](#license)
35
+
36
+ ---
37
+
38
+ ## Quick Start
39
+
40
+ ```bash
41
+ # Install via Homebrew (macOS)
42
+ brew tap AlexGladkov/claude-in-mobile https://github.com/AlexGladkov/claude-in-mobile
43
+ brew install claude-in-mobile
44
+
45
+ # Verify dependencies
46
+ claude-in-mobile doctor
47
+
48
+ # Add to Claude Code
49
+ claude mcp add --scope user --transport stdio mobile -- npx claude-in-mobile@latest
50
+ ```
51
+
52
+ Then talk to Claude naturally:
53
+
54
+ ```
55
+ "Take a screenshot of the Android emulator"
56
+ "Tap on the Login button"
57
+ "Type hello in the search field"
58
+ "Switch to iOS simulator"
59
+ ```
60
+
61
+ ---
62
+
63
+ ## Features at a Glance
64
+
65
+ | Feature | Description |
66
+ |---------|-------------|
67
+ | **Unified API** | Same 8 meta-tools work across Android, iOS, Desktop, Aurora, and Browser |
68
+ | **Token-optimized** | 8 meta-tools + 3 optional modules instead of 81 tools (~85% token reduction) |
69
+ | **Dynamic modules** | Browser, Desktop, Store load on demand — default tool list stays lean |
70
+ | **Smart screenshots** | Auto-compressed for optimal LLM processing |
71
+ | **Annotated screenshots** | Colored bounding boxes + numbered element labels |
72
+ | **Security hardened** | Shell injection protection, URL validation, path traversal blocking |
73
+ | **Structured errors** | Typed error codes with auto-recovery hints |
74
+ | **Multi-device parallel** | Run actions on multiple devices simultaneously |
75
+ | **Flow engine** | Batch, conditional loops, and fan-out flows |
76
+ | **Permission management** | Grant/revoke/reset app permissions (Android + iOS) |
77
+ | **Store publishing** | Google Play, Huawei AppGallery, RuStore |
78
+ | **Telemetry** | Per-tool call metrics via `system(action:'metrics')` |
79
+ | **Doctor command** | `claude-in-mobile doctor` — checks all dependencies at once |
80
+
81
+ ---
82
+
83
+ ## Quality Engineering
84
+
85
+ Advanced testing and monitoring built into Claude Mobile:
86
+
87
+ | Feature | What it does | How to use |
88
+ |---------|-------------|------------|
89
+ | **Accessibility Auditing** | WCAG 2.2 checks: missing labels, touch targets < 48px, focus order, duplicates | `accessibility(action:'audit')` |
90
+ | **Visual Regression** | Baseline screenshots + pixel-level diff detection | `visual(action:'baseline_save')`, `visual(action:'compare')` |
91
+ | **Test Recorder** | Record taps/swipes/input, replay without code | `recorder(action:'start')`, `recorder(action:'play')` |
92
+ | **Multi-Device Sync** | Barrier-based coordination for parallel testing | `sync(action:'create')`, `sync(action:'barrier')` |
93
+ | **App Autopilot** | Autonomous BFS/DFS exploration with self-healing locators | `autopilot(action:'explore')` |
94
+ | **Performance Monitor** | Real-time memory, CPU, FPS tracking with snapshots | `performance(action:'start')`, `performance(action:'snapshot')` |
95
+
96
+ ---
23
97
 
24
98
  ## Installation
25
99
 
26
- ### Native CLI via Homebrew (macOS)
100
+ ### Homebrew (macOS)
27
101
 
28
102
  ```bash
29
103
  brew tap AlexGladkov/claude-in-mobile https://github.com/AlexGladkov/claude-in-mobile
30
104
  brew install claude-in-mobile
31
105
  ```
32
106
 
33
- The CLI wraps all device automation tools plus store management (Google Play, Huawei AppGallery, RuStore):
107
+ Verify setup:
34
108
 
35
109
  ```bash
36
- claude-in-mobile screenshot android
37
- claude-in-mobile tap android 540 960 --from-size 540x960
38
- claude-in-mobile store upload --package com.example.app --file app.aab
39
- claude-in-mobile huawei upload --package com.example.app --file app.aab
40
- claude-in-mobile rustore upload --package com.example.app --file app.apk
110
+ claude-in-mobile doctor
41
111
  ```
42
112
 
43
113
  ### One-liner (any client)
44
114
 
45
- Using [add-mcp](https://github.com/neondatabase/add-mcp) — auto-detects installed clients:
115
+ Auto-detects installed clients via [add-mcp](https://github.com/neondatabase/add-mcp):
46
116
 
47
117
  ```bash
48
118
  npx add-mcp claude-in-mobile -y
49
119
  ```
50
120
 
51
- Or target a specific client:
121
+ Target a specific client:
52
122
 
53
123
  ```bash
54
124
  npx add-mcp claude-in-mobile -a claude-code -y
@@ -56,30 +126,39 @@ npx add-mcp claude-in-mobile -a opencode -y
56
126
  npx add-mcp claude-in-mobile -a cursor -y
57
127
  ```
58
128
 
59
- ### Claude Code CLI
129
+ ### Claude Code
60
130
 
61
131
  ```bash
132
+ # Project-local
62
133
  claude mcp add --transport stdio mobile -- npx claude-in-mobile@latest
134
+
135
+ # Global (all projects)
136
+ claude mcp add --scope user --transport stdio mobile -- npx claude-in-mobile@latest
63
137
  ```
64
138
 
65
- To add globally (available in all projects):
139
+ #### Claude Code Plugin
66
140
 
67
141
  ```bash
68
- claude mcp add --scope user --transport stdio mobile -- npx claude-in-mobile@latest
142
+ claude plugin marketplace add AlexGladkov/claude-in-mobile
143
+ claude plugin install claude-in-mobile@claude-in-mobile
69
144
  ```
70
145
 
71
146
  ### OpenCode
72
147
 
73
- Use the interactive setup:
148
+ Two modes:
149
+
150
+ **A) MCP server** (Node.js):
74
151
 
75
152
  ```bash
76
153
  opencode mcp add
154
+ # Choose local MCP → npx -y claude-in-mobile
77
155
  ```
78
156
 
79
- Or add manually to `opencode.json` (project root or `~/.config/opencode/opencode.json`):
157
+ Or in `opencode.json`:
80
158
 
81
159
  ```json
82
160
  {
161
+ "$schema": "https://opencode.ai/config.json",
83
162
  "mcp": {
84
163
  "mobile": {
85
164
  "type": "local",
@@ -90,89 +169,73 @@ Or add manually to `opencode.json` (project root or `~/.config/opencode/opencode
90
169
  }
91
170
  ```
92
171
 
93
- ### Cursor
94
-
95
- Add to `.cursor/mcp.json`:
172
+ **B) Native CLI + Skill** (no Node.js needed):
96
173
 
97
- ```json
98
- {
99
- "mcpServers": {
100
- "mobile": {
101
- "command": "npx",
102
- "args": ["-y", "claude-in-mobile"]
103
- }
104
- }
105
- }
174
+ ```bash
175
+ claude-in-mobile setup opencode # project-local
176
+ claude-in-mobile setup opencode --global # user-wide
106
177
  ```
107
178
 
108
- ### Any MCP Client
179
+ ### Other Agents
109
180
 
110
- Print a config snippet for your client:
181
+ Native CLI skill works with any agent that supports Agent Skills:
111
182
 
112
183
  ```bash
113
- npx claude-in-mobile --init <client-name>
114
- # Supported: opencode, cursor, claude-code
184
+ claude-in-mobile setup pi --global # Pi
185
+ claude-in-mobile setup qwen --global # Qwen Code
186
+ claude-in-mobile setup gemini --global # Gemini CLI
187
+ claude-in-mobile setup codex --global # Codex
188
+ claude-in-mobile setup cursor --global # Cursor
115
189
  ```
116
190
 
117
- ### From npm
191
+ Drop `--global` for project-local install. Restart the agent after setup.
118
192
 
119
- ```bash
120
- npx claude-in-mobile
121
- ```
193
+ <details>
194
+ <summary>MCP server config for Qwen / Gemini / Codex / Cursor</summary>
122
195
 
123
- ### From source
196
+ **Qwen Code** — `.qwen/settings.json` or `~/.qwen/settings.json`:
124
197
 
125
- ```bash
126
- git clone https://github.com/AlexGladkov/claude-in-mobile.git
127
- cd claude-in-mobile
128
- npm install
129
- npm run build:all # Builds TypeScript + Desktop companion
198
+ ```json
199
+ { "mcpServers": { "mobile": { "command": "npx", "args": ["-y", "claude-in-mobile"] } } }
130
200
  ```
131
201
 
132
- > **Note:** For Desktop support, you need to run `npm run build:desktop` (or `build:all`) to compile the Desktop companion app.
202
+ **Gemini CLI** `.gemini/settings.json` or `~/.gemini/settings.json`:
133
203
 
134
- #### Using a local build with MCP clients
204
+ ```json
205
+ { "mcpServers": { "mobile": { "command": "npx", "args": ["-y", "claude-in-mobile"] } } }
206
+ ```
135
207
 
136
- After building from source, point your MCP client to the local `dist/index.js` instead of using npx:
208
+ **Codex**:
137
209
 
138
- ```json
139
- {
140
- "mcpServers": {
141
- "mobile": {
142
- "command": "node",
143
- "args": ["/path/to/claude-in-mobile/dist/index.js"]
144
- }
145
- }
146
- }
210
+ ```bash
211
+ codex mcp add mobile -- npx -y claude-in-mobile
147
212
  ```
148
213
 
149
- For OpenCode (`opencode.json`):
214
+ **Cursor** `.cursor/mcp.json`:
150
215
 
151
216
  ```json
152
- {
153
- "mcp": {
154
- "mobile": {
155
- "type": "local",
156
- "command": ["node", "/path/to/claude-in-mobile/dist/index.js"],
157
- "enabled": true
158
- }
159
- }
160
- }
217
+ { "mcpServers": { "mobile": { "command": "npx", "args": ["-y", "claude-in-mobile"] } } }
161
218
  ```
162
219
 
163
- ### Manual configuration
220
+ </details>
164
221
 
165
- Add to your Claude Code settings (`~/.claude.json` or project settings):
222
+ ### From npm / source
223
+
224
+ ```bash
225
+ # npm (no install)
226
+ npx claude-in-mobile
227
+
228
+ # From source
229
+ git clone https://github.com/AlexGladkov/claude-in-mobile.git
230
+ cd claude-in-mobile
231
+ npm install
232
+ npm run build:all
233
+ ```
234
+
235
+ Using a local build with any MCP client:
166
236
 
167
237
  ```json
168
- {
169
- "mcpServers": {
170
- "mobile": {
171
- "command": "npx",
172
- "args": ["-y", "claude-in-mobile"]
173
- }
174
- }
175
- }
238
+ { "mcpServers": { "mobile": { "command": "node", "args": ["/path/to/claude-in-mobile/dist/index.js"] } } }
176
239
  ```
177
240
 
178
241
  ### Windows
@@ -181,156 +244,266 @@ Add to your Claude Code settings (`~/.claude.json` or project settings):
181
244
  claude mcp add --transport stdio mobile -- cmd /c npx claude-in-mobile@latest
182
245
  ```
183
246
 
184
- ## Requirements
247
+ ---
248
+
249
+ ## Platform Guides
185
250
 
186
251
  ### Android
187
- - ADB installed and in PATH
188
- - Connected Android device (USB debugging enabled) or emulator
189
252
 
190
- ### iOS
191
- - macOS with Xcode installed
192
- - iOS Simulator (no physical device support yet)
193
- - **WebDriverAgent** for full UI inspection and element-based interaction:
194
- ```bash
195
- npm install -g appium
196
- appium driver install xcuitest
197
- ```
198
- Or set `WDA_PATH` environment variable to custom WebDriverAgent location
253
+ **Requirements:**
254
+ - ADB installed (auto-discovered or set `ADB_PATH`)
255
+ - USB debugging enabled on device, or running emulator
199
256
 
200
- ### Desktop
201
- - macOS (Windows/Linux support planned)
202
- - JDK 17+ for building the Desktop companion
203
- - Compose Multiplatform desktop application to test
257
+ **ADB discovery order:**
204
258
 
205
- ### Aurora OS
206
- - audb CLI installed and in PATH (`cargo install audb-client`)
207
- - Connected Aurora OS device with SSH enabled
208
- - Python on device required for tap/swipe: `devel-su pkcon install python`
259
+ | Priority | Location |
260
+ |----------|----------|
261
+ | 1 | `ADB_PATH` env var |
262
+ | 2 | `$ANDROID_HOME/platform-tools/adb` |
263
+ | 3 | `$ANDROID_SDK_ROOT/platform-tools/adb` |
264
+ | 4 | OS default: `~/Library/Android/sdk` (macOS), `%LOCALAPPDATA%\Android\Sdk` (Windows), `~/Android/Sdk` (Linux) |
265
+ | 5 | `adb` from `PATH` |
209
266
 
210
- ## Available Tools
267
+ If none found → `[ADB_NOT_INSTALLED]` error with probed paths.
211
268
 
212
- v3.4.0 consolidates tools into **8 core meta-tools** + **3 optional modules**. Each meta-tool uses an `action` parameter to select the operation. All v3.0/v3.1 tool names still work as backward-compatible aliases.
269
+ **Examples:**
213
270
 
214
- ### Core Meta-Tools (always loaded)
271
+ ```
272
+ "Show connected devices"
273
+ "Take a screenshot on Android"
274
+ "Tap on Settings"
275
+ "Swipe down to scroll"
276
+ "Type 'hello' in the search field"
277
+ "Press the back button"
278
+ "Grant camera permission to com.example.app"
279
+ "Launch com.example.app"
280
+ ```
215
281
 
216
- | Meta-Tool | Actions | Description |
217
- |-----------|---------|-------------|
218
- | `device` | `list`, `set`, `set_target`, `get_target`, `enable_module`, `disable_module`, `list_modules` | Device management and module control |
219
- | `input` | `tap`, `double_tap`, `long_press`, `swipe`, `text`, `key` | Touch/keyboard input |
220
- | `screen` | `capture`, `annotate` | Screenshots and visual annotation |
221
- | `ui` | `tree`, `find`, `find_tap`, `tap_text`, `analyze`, `wait`, `assert_visible`, `assert_gone` | UI hierarchy and element interaction |
222
- | `app` | `launch`, `stop`, `install`, `list` | App lifecycle management |
223
- | `system` | `activity`, `shell`, `wait`, `open_url`, `logs`, `clear_logs`, `info`, `webview`, `clipboard_*`, `permission_*`, `file_*`, `metrics`, `reset_metrics` | System operations, clipboard, permissions, files, telemetry |
224
- | `flow_batch` | — | Execute multiple commands in one round-trip |
225
- | `flow_run` | — | Multi-step automation with conditionals and loops |
282
+ **CLI:**
226
283
 
227
- ### Optional Modules (loaded on demand)
284
+ ```bash
285
+ claude-in-mobile screenshot android
286
+ claude-in-mobile tap android 540 960
287
+ claude-in-mobile input android "hello world"
288
+ claude-in-mobile ui-dump android | grep "Login"
289
+ ```
228
290
 
229
- These modules are hidden by default to save tokens. They auto-enable when you call them, or use `device(action:'enable_module', module:'<name>')`.
291
+ ---
230
292
 
231
- | Module | Actions | Description |
232
- |--------|---------|-------------|
233
- | `browser` | `open`, `close`, `list_sessions`, `navigate`, `click`, `fill`, `fill_form`, `press_key`, `snapshot`, `screenshot`, `evaluate`, `wait_for_selector`, `clear_session` | Chrome/Chromium automation via CDP |
234
- | `desktop` | `launch`, `stop`, `windows`, `focus`, `resize`, `clipboard_get`, `clipboard_set`, `performance`, `monitors` | Compose Desktop app testing |
235
- | `store` | `upload`, `set_notes`, `submit`, `get_releases`, `discard`, `promote`, `halt_rollout`, `get_versions` | Google Play, Huawei AppGallery, RuStore publishing |
293
+ ### iOS
236
294
 
237
- ### Flow Tools
295
+ **Requirements:**
296
+ - macOS with Xcode
297
+ - iOS Simulator (no physical device support yet)
298
+ - WebDriverAgent for full UI inspection (optional but recommended)
238
299
 
239
- | Tool | Description |
240
- |------|-------------|
241
- | `flow_batch` | Sequential execution of multiple commands in one round-trip (max 50) |
242
- | `flow_run` | Multi-step flows with `if_not_found`, `repeat`, `on_error` handling (max 20 steps) |
243
- | `flow_parallel` | Run the same action on multiple devices concurrently via `Promise.allSettled` (max 10 devices) |
300
+ **WebDriverAgent setup:**
244
301
 
245
- ### Backward Compatibility
302
+ ```bash
303
+ # Automatic (via Appium)
304
+ npm install -g appium
305
+ appium driver install xcuitest
246
306
 
247
- All v3.0/v3.1 tool names work as aliases. For example, `tap` maps to `input(action:'tap')`, `screenshot` maps to `screen(action:'capture')`, `launch_app` maps to `app(action:'launch')`.
307
+ # Or set custom path
308
+ export WDA_PATH=/path/to/WebDriverAgent
309
+ ```
248
310
 
249
- > For detailed Desktop API documentation, see [Desktop Specification](docs/SPEC_DESKTOP.md)
311
+ On first use, WDA is auto-built (~2 min one-time), launched on simulator, and connected on port 8100+.
250
312
 
251
- ## Usage Examples
313
+ **What WDA enables:**
314
+ - `ui(action:'tree')` — full accessibility tree
315
+ - `ui(action:'find')` — element discovery by label/text
316
+ - `input(action:'tap', label:'...')` — element-based tapping
317
+ - Improved swipe and gesture simulation
252
318
 
253
- Just talk to Claude naturally:
319
+ **Troubleshooting:**
254
320
 
255
- ```
256
- "Show me all connected devices"
257
- "Take a screenshot of the Android emulator"
258
- "Take a screenshot on iOS"
259
- "Tap on Settings"
260
- "Swipe down to scroll"
261
- "Type 'hello world' in the search field"
262
- "Press the back button on Android"
263
- "Open Safari on iOS"
264
- "Switch to iOS simulator"
265
- "Run the app on both platforms"
266
- ```
321
+ ```bash
322
+ # Install Xcode CLI tools
323
+ xcode-select --install
267
324
 
268
- ### Permission Management
325
+ # Accept license
326
+ sudo xcodebuild -license accept
269
327
 
270
- ```
271
- "Grant camera permission to com.example.app on Android"
272
- "Revoke location access from com.example.app"
273
- "Reset all permissions for com.apple.Maps on iOS"
328
+ # Check simulator is booted
329
+ xcrun simctl list | grep Booted
330
+
331
+ # Check port
332
+ lsof -i :8100
274
333
  ```
275
334
 
276
- ### Annotated Screenshots
335
+ <details>
336
+ <summary>Manual WDA test</summary>
277
337
 
278
- ```
279
- "Take an annotated screenshot" → Screenshot with green (clickable) and red (non-clickable) bounding boxes + numbered element index
338
+ ```bash
339
+ cd ~/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent
340
+ xcodebuild test -project WebDriverAgent.xcodeproj \
341
+ -scheme WebDriverAgentRunner \
342
+ -destination 'platform=iOS Simulator,id=<DEVICE_UDID>'
280
343
  ```
281
344
 
282
- ### Platform Selection
345
+ </details>
283
346
 
284
- You can explicitly specify the platform:
347
+ **Examples:**
285
348
 
286
349
  ```
287
- "Screenshot on android" → Uses Android device
288
- "Screenshot on ios" → Uses iOS simulator
289
- "Screenshot on desktop" → Uses Desktop app
290
- "Screenshot on aurora" → Uses Aurora OS device
291
- "Screenshot" → Uses last active device
350
+ "Take a screenshot on iOS"
351
+ "Open Safari on iOS"
352
+ "Tap on the Login button"
353
+ "Type my email in the text field"
354
+ "Swipe left on the card"
355
+ "Reset all permissions for com.apple.Maps"
292
356
  ```
293
357
 
294
- Or set the active device:
358
+ ---
359
+
360
+ ### Desktop
361
+
362
+ **Requirements:**
363
+ - macOS (Windows/Linux planned)
364
+ - Accessibility permissions: System Settings → Privacy & Security → Accessibility
365
+ - JDK 17+ (for building Desktop companion)
366
+
367
+ **Supported apps:** Any macOS application — SwiftUI, AppKit, Electron, Compose Desktop.
368
+
369
+ **Launch modes:**
370
+
371
+ | Mode | Example |
372
+ |------|---------|
373
+ | By `bundleId` | `desktop(action:'launch', bundleId:'com.apple.Calculator')` |
374
+ | By `.app` path | `desktop(action:'launch', appPath:'/Applications/Slack.app')` |
375
+ | Attach by PID | `desktop(action:'launch', pid:12345)` |
376
+
377
+ **Enable the module first:**
295
378
 
296
379
  ```
297
- "Use the iPhone 15 simulator"
298
- "Switch to the Android emulator"
299
- "Switch to desktop"
300
- "Switch to Aurora device"
380
+ "Enable desktop module"
301
381
  ```
302
382
 
303
- ### Desktop Examples
383
+ Or it auto-enables on first `desktop(...)` call.
384
+
385
+ **Examples:**
304
386
 
305
387
  ```
306
- "Launch my desktop app from /path/to/app"
388
+ "Launch Calculator"
307
389
  "Take a screenshot of the desktop app"
308
- "Get window info"
390
+ "Get window list"
309
391
  "Resize window to 1280x720"
310
- "Tap at coordinates 100, 200"
392
+ "Tap at 100, 200 on desktop"
311
393
  "Get clipboard content"
312
- "Set clipboard to 'test text'"
313
394
  "Get performance metrics"
314
395
  "Stop the desktop app"
315
396
  ```
316
397
 
317
- ### Aurora Examples
398
+ > Full API documentation: [docs/SPEC_DESKTOP.md](docs/SPEC_DESKTOP.md)
399
+
400
+ ---
401
+
402
+ ### Browser
403
+
404
+ **Requirements:**
405
+ - Chrome or Chromium installed (or set `CHROME_PATH`)
406
+
407
+ Browser automation via Chrome DevTools Protocol (CDP). The `browser` module loads on demand.
408
+
409
+ **Examples:**
410
+
411
+ ```
412
+ "Open https://example.com in the browser"
413
+ "Click the Sign In button"
414
+ "Fill the email field with test@example.com"
415
+ "Take a browser screenshot"
416
+ "Execute JS: document.title"
417
+ "Wait for the loading spinner to disappear"
418
+ ```
419
+
420
+ **Available actions:**
421
+
422
+ | Action | Description |
423
+ |--------|-------------|
424
+ | `open` | Open URL in new session |
425
+ | `navigate` | Go to URL in existing session |
426
+ | `click` | Click element by ref |
427
+ | `fill` | Type into input field |
428
+ | `fill_form` | Fill multiple fields at once |
429
+ | `press_key` | Keyboard input |
430
+ | `snapshot` | DOM snapshot with element refs |
431
+ | `screenshot` | Visual screenshot |
432
+ | `evaluate` | Run JavaScript |
433
+ | `wait_for_selector` | Wait for element to appear |
434
+ | `close` | Close session |
435
+ | `list_sessions` | Show active sessions |
436
+ | `clear_session` | Reset cookies/storage |
437
+
438
+ ---
439
+
440
+ ### Aurora OS
441
+
442
+ **Requirements:**
443
+ - `audb` CLI: `cargo install audb-client`
444
+ - SSH-enabled Aurora OS device
445
+ - Python on device for tap/swipe: `devel-su pkcon install python`
446
+
447
+ **Examples:**
318
448
 
319
449
  ```
320
- "List all Aurora devices"
450
+ "List Aurora devices"
321
451
  "Take a screenshot on Aurora"
322
- "Tap at coordinates 100, 200 on Aurora"
452
+ "Tap at 100, 200 on Aurora"
323
453
  "Launch ru.example.app on Aurora"
324
- "List installed apps on Aurora device"
454
+ "List installed apps on Aurora"
325
455
  "Get logs from Aurora device"
326
- "Push file.txt to /home/defaultuser/ on Aurora device"
456
+ "Push file.txt to /home/defaultuser/"
327
457
  ```
328
458
 
459
+ ---
460
+
461
+ ## Tools Reference
462
+
463
+ v3.8.0 provides **8 core meta-tools** + **3 optional modules**. Each meta-tool uses an `action` parameter.
464
+
465
+ ### Core Meta-Tools
466
+
467
+ | Meta-Tool | Actions | Description |
468
+ |-----------|---------|-------------|
469
+ | `device` | `list`, `set`, `set_target`, `get_target`, `enable_module`, `disable_module`, `list_modules` | Device management, module control |
470
+ | `input` | `tap`, `double_tap`, `long_press`, `swipe`, `text`, `key` | Touch and keyboard input |
471
+ | `screen` | `capture`, `annotate` | Screenshots and visual annotation |
472
+ | `ui` | `tree`, `find`, `find_tap`, `tap_text`, `analyze`, `wait`, `assert_visible`, `assert_gone` | UI hierarchy, element interaction |
473
+ | `app` | `launch`, `stop`, `install`, `list` | App lifecycle |
474
+ | `system` | `activity`, `shell`, `wait`, `open_url`, `logs`, `clear_logs`, `info`, `webview`, `clipboard_*`, `permission_*`, `file_*`, `metrics`, `reset_metrics` | System ops, clipboard, permissions, files, telemetry |
475
+ | `flow_batch` | — | Execute multiple commands in one round-trip (max 50) |
476
+ | `flow_run` | — | Multi-step automation with conditionals and loops (max 20 steps) |
477
+
478
+ ### Optional Modules
479
+
480
+ Load on demand via `device(action:'enable_module', module:'<name>')` or auto-enable on first call.
481
+
482
+ | Module | Actions | Description |
483
+ |--------|---------|-------------|
484
+ | `browser` | `open`, `close`, `list_sessions`, `navigate`, `click`, `fill`, `fill_form`, `press_key`, `snapshot`, `screenshot`, `evaluate`, `wait_for_selector`, `clear_session` | Chrome/Chromium via CDP |
485
+ | `desktop` | `launch`, `stop`, `windows`, `focus`, `resize`, `clipboard_get`, `clipboard_set`, `performance`, `monitors` | Any macOS app |
486
+ | `store` | `upload`, `set_notes`, `submit`, `get_releases`, `discard`, `promote`, `halt_rollout`, `get_versions` | Google Play, Huawei AppGallery, RuStore |
487
+
488
+ ### Flow Tools
489
+
490
+ | Tool | Description |
491
+ |------|-------------|
492
+ | `flow_batch` | Sequential execution, one round-trip (max 50 commands) |
493
+ | `flow_run` | Multi-step flows with `if_not_found`, `repeat`, `on_error` (max 20 steps) |
494
+ | `flow_parallel` | Same action on multiple devices via `Promise.allSettled` (max 10) |
495
+
496
+ ### Backward Compatibility
497
+
498
+ All v3.0/v3.1 tool names work as aliases: `tap` → `input(action:'tap')`, `screenshot` → `screen(action:'capture')`, `launch_app` → `app(action:'launch')`, etc.
499
+
500
+ ---
501
+
329
502
  ## Native CLI
330
503
 
331
- A 2 MB native Rust binary with all the same commands. No Node.js, no dependencies.
504
+ 2 MB Rust binary. No Node.js, no dependencies.
332
505
 
333
- ### Install CLI
506
+ ### Install
334
507
 
335
508
  ```bash
336
509
  brew tap AlexGladkov/claude-in-mobile
@@ -339,15 +512,16 @@ brew install claude-in-mobile
339
512
 
340
513
  Or download from [Releases](https://github.com/AlexGladkov/claude-in-mobile/releases).
341
514
 
342
- ### Advantages over MCP
515
+ ### Why use the CLI
343
516
 
344
- - **Easy install** `brew install` or copy a single 2 MB binary
345
- - **No dependencies** — no Node.js, no npm, nothing
346
- - **Use from terminal** run commands directly, no Claude Code or MCP client needed
347
- - **Test automation** write universal `.sh` scripts for any platform without learning platform internals
348
- - **Token-efficient** skill documentation loads only when used; MCP v3.4.0 reduced schema overhead by ~85% (8 meta-tools vs 81 individual tools)
349
- - **Fast** ~5ms command startup (Rust) vs ~500ms (Node.js MCP)
350
- - **CI/CD ready** exit codes, stdout/stderr, runs anywhere
517
+ | | CLI | MCP Server |
518
+ |---|---|---|
519
+ | **Install** | `brew install` or copy binary | `npx` / npm |
520
+ | **Dependencies** | None | Node.js |
521
+ | **Startup** | ~5ms | ~500ms |
522
+ | **Use from terminal** | Direct commands | Needs MCP client |
523
+ | **CI/CD** | Exit codes, stdout/stderr | Not designed for CI |
524
+ | **Token cost** | Skill loads on demand | Schema always present |
351
525
 
352
526
  ### Test script example
353
527
 
@@ -361,75 +535,27 @@ claude-in-mobile screenshot android -o result.png
361
535
  claude-in-mobile ui-dump android | grep "Welcome" && echo "PASS" || echo "FAIL"
362
536
  ```
363
537
 
364
- ### Claude Code Plugin
538
+ ### Store management (CLI)
365
539
 
366
540
  ```bash
367
- claude plugin marketplace add AlexGladkov/claude-in-mobile
368
- claude plugin install claude-in-mobile@claude-in-mobile
369
- ```
370
-
371
- After installing, Claude Code controls devices with natural language. The skill loads into context only on demand — no token overhead when not in use.
372
-
373
- See [cli/README.md](cli/README.md) for full CLI documentation.
374
-
375
- ## iOS WebDriverAgent Setup
376
-
377
- For full iOS UI inspection and element-based interaction, WebDriverAgent is required. It enables:
378
- - `get_ui` - JSON accessibility tree inspection
379
- - `tap` with `label` or `text` parameters - Element-based tapping
380
- - `find_element` - Element discovery and querying
381
- - `swipe` - Improved gesture simulation
382
-
383
- ### Installation
384
-
385
- **Automatic (via Appium):**
386
- ```bash
387
- npm install -g appium
388
- appium driver install xcuitest
389
- ```
390
-
391
- **Manual:**
392
- Set the `WDA_PATH` environment variable to your WebDriverAgent location:
393
- ```bash
394
- export WDA_PATH=/path/to/WebDriverAgent
541
+ claude-in-mobile store upload --package com.example.app --file app.aab
542
+ claude-in-mobile huawei upload --package com.example.app --file app.aab
543
+ claude-in-mobile rustore upload --package com.example.app --file app.apk
395
544
  ```
396
545
 
397
- ### First Use
398
-
399
- On first use, WebDriverAgent will be automatically:
400
- 1. Discovered from Appium installation or `WDA_PATH`
401
- 2. Built with xcodebuild (one-time, ~2 minutes)
402
- 3. Launched on the iOS simulator
403
- 4. Connected via HTTP on port 8100+
546
+ ### Doctor
404
547
 
405
- ### Troubleshooting
548
+ Check all dependencies at once:
406
549
 
407
- **Build fails:**
408
550
  ```bash
409
- # Install Xcode command line tools
410
- xcode-select --install
411
-
412
- # Accept license
413
- sudo xcodebuild -license accept
414
-
415
- # Set Xcode path
416
- sudo xcode-select -s /Applications/Xcode.app
551
+ claude-in-mobile doctor
417
552
  ```
418
553
 
419
- **Session fails:**
420
- - Ensure simulator is booted: `xcrun simctl list | grep Booted`
421
- - Check port availability: `lsof -i :8100`
422
- - Try restarting the simulator
554
+ Checks: ADB, ANDROID_HOME, Xcode, simctl, Appium, WDA, JDK, audb-client, Chrome. Color-coded output with fix suggestions.
423
555
 
424
- **Manual test:**
425
- ```bash
426
- cd ~/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent
427
- xcodebuild test -project WebDriverAgent.xcodeproj \
428
- -scheme WebDriverAgentRunner \
429
- -destination 'platform=iOS Simulator,id=<DEVICE_UDID>'
430
- ```
556
+ ---
431
557
 
432
- ## How It Works
558
+ ## Architecture
433
559
 
434
560
  ```
435
561
  ┌─────────────┐ ┌──────────────────┐ ┌─────────────────┐
@@ -437,19 +563,21 @@ xcodebuild test -project WebDriverAgent.xcodeproj \
437
563
  ├─────────────┤ │ Claude Mobile │ ├─────────────────┤
438
564
  │ OpenCode │────▶│ MCP Server │────▶│ iOS (simctl+WDA)│
439
565
  ├─────────────┤ │ │ ├─────────────────┤
440
- │ Cursor │────▶│ 8 meta-tools │────▶│ Desktop (Compose)│
566
+ │ Cursor │────▶│ 8 meta-tools │────▶│ Desktop (macOS)
441
567
  ├─────────────┤ │ + 3 modules │ ├─────────────────┤
442
- Any MCP │────▶│ (auto-detects │────▶│ Aurora (audb) │
443
- Client│ client) │ ├─────────────────┤
444
- └─────────────┘ │────▶│ Browser (CDP) │
445
- └──────────────────┘ └─────────────────┘
568
+ Qwen/Gemini │────▶│ │────▶│ Aurora (audb) │
569
+ ├─────────────┤ Auto-detects │ ├─────────────────┤
570
+ Any MCP │────▶│ platform │────▶│ Browser (CDP) │
571
+ └─────────────┘ └──────────────────┘ └─────────────────┘
446
572
  ```
447
573
 
448
- 1. Claude sends commands through MCP protocol (8 meta-tools + 3 optional modules)
449
- 2. Server routes to appropriate platform (ADB, simctl+WDA, Desktop, audb, or CDP)
450
- 3. Commands execute on your device, desktop app, or browser
451
- 4. Results (screenshots, UI data, metrics) return to Claude
452
- 5. Dynamic modules auto-enable when first called — no manual setup needed
574
+ 1. Client sends commands via MCP protocol (8 meta-tools + 3 optional modules)
575
+ 2. Server routes to platform adapter (ADB, simctl+WDA, Desktop, audb, CDP)
576
+ 3. Commands execute on device/app/browser
577
+ 4. Results (screenshots, UI trees, metrics) return to client
578
+ 5. Modules auto-enable on first call — no manual setup needed
579
+
580
+ ---
453
581
 
454
582
  ## License
455
583