mobridge-mcp 0.10.5 → 0.12.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.
package/AI-USAGE.md CHANGED
@@ -103,8 +103,11 @@ After an install/update, connect waits for the companion to become ready (a few
103
103
  - Semantic UI (find/click/type/scroll/BACK/HOME/wait) runs through Accessibility; package/process/permission/settings/log/perf run through ADB; opening an app, permission flows, notifications and ads are hybrid; canvas/games/unlabeled icons use vision.
104
104
  - With a clear goal call one act directly; find is only for checking or when ambiguous. Several steps: mobile.run/mobridge run or mobridge session --jsonl; one-shot CLI is for single operations only.
105
105
  - permission respond answers the dialog that is showing (resource-id, not pm grant); permission set changes state with pm grant/revoke and reads it back to verify. The two do not replace each other.
106
+ - A capture result lists targets [{name, role, at}]: the named controls on the image with the point that clicks each; use that at, never a point estimated from pixels. An observe element with contains [texts] is an unnamed clickable row: click it by query text.
106
107
  - NEEDS_VISION: read the current capture (it has a captureId), pick a point on the image, then act CLICK {at:{captureId,x,y}} (dynamic UI such as ads/video/countdown timers: stalePolicy VISUAL_DYNAMIC, act within 8 s); an old image gives STALE_CAPTURE. Never guess coordinates. Find by colour: capture {color:{hex}} → colorMatch. A control without a node: capture {scan:{}} → regionScan.regions[] (regionId, bounds, position, semanticNode, at): neutral facts that do not name the icon. Look at the image, choose a region, act CLICK {at}; if unsure it stays NEEDS_VISION, do not guess.
107
108
  - Do not change executor after a dispatch that may have run (timeout/dropped connection): the result is RESULT_UNKNOWN, look up the operation status, do not resend over ADB.
109
+ - adb replacements (typed, verified): file ls|stat|pull|push|rm (--recursive, --run-as), intent start|broadcast|service|stop-service, settings get|put|restore, prop, logcat, keycode, device wake|sleep|rotate|stay-awake|..., forward|reverse; shell <command> (raw adb shell) and adb -- <args> for everything else; chain/parallel/session for several steps. Only uiautomator is refused. Over MCP use mobile.run steps (logcat, file, intent, settings, prop, shell, adb).
110
+ - `key`/`gesture` with --verify DISPATCH_ONLY (MCP: verify.policy DISPATCH_ONLY) skip the screen wait: ~200 ms instead of ~400-740 ms, no verification.
108
111
  - Do not use raw adb when a typed command exists. mobridge capabilities [--family F] lists each op's executor, replay class and verification.
109
112
 
110
113
  ## Choose the tool by goal
@@ -164,15 +167,19 @@ A `wait` condition is always wrapped in nodeExists/nodeAbsent/anyOf/allOf, never
164
167
  ## Typed commands (generated from the registry)
165
168
 
166
169
  - app: app clear · app force · app list · open
167
- - device: devices · health --preflight · health · doctor · doctor --restart-adb · connect · state
170
+ - device: devices · health --preflight · health · doctor · doctor --restart-adb · connect · device · state · forward
168
171
  - diag: diag
172
+ - diagnostics: adb · logcat · logcat --clear · shell · shell run
169
173
  - fallback: fallback cancel · fallback commit · fallback prepare · fallback status
170
- - input: gesture · type · key
174
+ - file: file ls · file pull · file push · file rm · file stat
175
+ - input: gesture · type · key send · key
176
+ - intent: intent broadcast · intent service · intent start · intent stop-service
171
177
  - operation: operation status · trace
172
178
  - package: app install · app uninstall
173
179
  - permission: permission set · permission set --revoke · permission respond
174
180
  - run: batch · run · scenario
175
181
  - screen: screen act click | type | scroll · screen act at · analyze · screen burst · screen capture · diff · find · inspect · screen observe · record · screen act scroll · wait · watch
182
+ - settings: prop get · settings get · settings put · settings restore
176
183
 
177
184
  ## Examples
178
185
 
package/README.md CHANGED
@@ -136,6 +136,25 @@ Two or more steps: send a JSONL plan instead of many calls. The daemon keeps the
136
136
  5. Do not call `adb`, `uiautomator` or coordinate taps from the agent; use the typed tools.
137
137
  6. Coordinates from a capture are valid only for that capture (`STALE_CAPTURE` otherwise).
138
138
 
139
+ ## Use MoBridge instead of adb
140
+
141
+ Logs, files, intents, settings, keys, power, ports and raw shell all have MoBridge commands, so an agent never needs bare `adb`:
142
+
143
+ | adb habit | MoBridge |
144
+ |---|---|
145
+ | `adb logcat -d` | `mobridge logcat --tag Tag:D --max-lines 200 [--since cursor] [--follow ms]` |
146
+ | `adb push` / `pull` | `mobridge file push\|pull <path> [--recursive] [--run-as pkg]` (SHA-256 verified) |
147
+ | `am start` / `broadcast` / `startservice` | `mobridge intent start\|broadcast\|service\|stop-service` |
148
+ | `settings get` / `put` | `mobridge settings get\|put\|restore [--restore-on-exit]` |
149
+ | `input keyevent`, `svc`, rotation, reboot | `mobridge keycode`, `mobridge device wake\|sleep\|rotate\|stay-awake\|reboot\|tcpip\|usb` |
150
+ | `adb forward` / `reverse` | `mobridge forward\|reverse list\|add\|remove` |
151
+ | `adb shell <anything>` / `adb <anything>` | `mobridge shell <command>` / `mobridge adb -- <args>` |
152
+ | several commands | `mobridge chain`, `parallel`, `session --jsonl`, or `mobile.run` steps over MCP |
153
+
154
+ `shell` and `adb` have no allowlist and ask for no approval, the same trust level as `adb`; only `uiautomator` is refused because it
155
+ breaks the accessibility session. Typed commands read back or hash-check their result; `shell`, `adb` and `key` only dispatch.
156
+ The skill `mobridge-adb` (installed with the skill pack) teaches an agent this map; the full reference is in its `references/commands.md`.
157
+
139
158
  ## Troubleshooting
140
159
 
141
160
  `mobile.device.connect` does the whole setup: installs the companion APK if missing, updates it when it differs from the host version, enables Accessibility over ADB, creates the port forward and waits for the companion to answer. You never run `adb` yourself. If it fails, read `error.code`, then `details.diagnostics` and `recovery[0]`: