mobile-debug-mcp 0.34.0 → 0.35.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/.agents/skills/mcp-builder/SKILL.md +44 -64
- package/.agents/skills/mcp-builder/references/build-flags.md +44 -43
- package/.agents/skills/mcp-builder/references/diagnostics-schema.md +4 -1
- package/.agents/skills/mcp-builder/references/toolchain-details.md +49 -62
- package/.agents/skills/spec-review/references/spec-review-checklist.md +7 -0
- package/.agents/skills/test-authoring/SKILL.md +7 -6
- package/.agents/skills/test-authoring/references/repo-test-layout.md +3 -1
- package/.agents/skills/test-authoring/references/test-authoring-workflow.md +16 -7
- package/.agents/skills/test-authoring/references/test-quality-checklist.md +2 -1
- package/.github/copilot-instructions.md +14 -36
- package/.github/workflows/ci.yml +4 -4
- package/AGENTS.md +12 -3
- package/CONTRIBUTING.md +79 -0
- package/README.md +156 -129
- package/agent-plugin/.claude-plugin/plugin.json +2 -2
- package/agent-plugin/.codex-plugin/plugin.json +1 -1
- package/agent-plugin/.cursor-plugin/plugin.json +2 -2
- package/agent-plugin/.mcp.json +1 -1
- package/agent-plugin/README.md +16 -6
- package/agent-plugin/mcp.json +1 -1
- package/agent-plugin/plugin.json +1 -1
- package/agent-plugin/skills/mobile-debug-mcp/SKILL.md +27 -2
- package/dist/contracts/execution-controls.js +24 -0
- package/dist/contracts/selector.js +8 -0
- package/dist/contracts/target.js +15 -0
- package/dist/contracts/ui.js +1 -0
- package/dist/debugger/android.js +2 -1
- package/dist/debugger/diagnostics.js +54 -0
- package/dist/debugger/protocol.js +33 -0
- package/dist/debugger/sessions.js +104 -62
- package/dist/debugger/worker.js +53 -42
- package/dist/interact/adjustment/adjustment-context.js +41 -0
- package/dist/interact/adjustment/adjustment-gestures.js +55 -0
- package/dist/interact/adjustment/adjustment-plan.js +18 -0
- package/dist/interact/adjustment/adjustment-resolution.js +127 -0
- package/dist/interact/adjustment/adjustment-result.js +19 -0
- package/dist/interact/adjustment/adjustment-semantic.js +64 -0
- package/dist/interact/adjustment/adjustment-verification.js +35 -0
- package/dist/interact/adjustment/adjustment.js +52 -0
- package/dist/interact/adjustment/control-geometry.js +87 -0
- package/dist/interact/adjustment/control-values.js +136 -0
- package/dist/interact/adjustment/slider-labels.js +84 -0
- package/dist/interact/assertions/screen-assertion.js +37 -0
- package/dist/interact/assertions/state-assertion-context.js +35 -0
- package/dist/interact/assertions/state-assertion.js +76 -0
- package/dist/interact/assertions/state-comparison.js +141 -0
- package/dist/interact/assertions/visibility-assertion.js +34 -0
- package/dist/interact/conditional-action.js +12 -7
- package/dist/interact/index.js +65 -3090
- package/dist/interact/input-service.js +1 -0
- package/dist/interact/interaction-trace.js +21 -0
- package/dist/interact/model.js +1 -0
- package/dist/interact/observation.js +1 -0
- package/dist/interact/targeting/candidate-ancestor.js +58 -0
- package/dist/interact/targeting/candidate-result.js +23 -0
- package/dist/interact/targeting/candidate-scoring.js +50 -0
- package/dist/interact/targeting/element-helpers.js +216 -0
- package/dist/interact/targeting/find-element.js +65 -0
- package/dist/interact/targeting/nearby-control.js +56 -0
- package/dist/interact/targeting/resolved-elements.js +21 -0
- package/dist/interact/targeting/tap-target.js +17 -0
- package/dist/interact/targeting/target-scope.js +104 -0
- package/dist/interact/waits/legacy-log-wait.js +38 -0
- package/dist/interact/waits/legacy-wait-observations.js +103 -0
- package/dist/interact/waits/legacy-wait-state.js +34 -0
- package/dist/interact/waits/legacy-wait.js +48 -0
- package/dist/interact/waits/screen-wait.js +49 -0
- package/dist/interact/waits/ui-change-helpers.js +157 -0
- package/dist/interact/waits/ui-change-state.js +18 -0
- package/dist/interact/waits/ui-change-wait.js +77 -0
- package/dist/interact/waits/ui-wait-condition.js +56 -0
- package/dist/interact/waits/ui-wait-state.js +38 -0
- package/dist/interact/waits/ui-wait.js +106 -0
- package/dist/manage/android.js +55 -51
- package/dist/manage/index.js +38 -75
- package/dist/manage/ios/build-types.js +1 -0
- package/dist/manage/ios/build.js +210 -0
- package/dist/manage/ios/project-discovery.js +29 -0
- package/dist/manage/ios/scheme.js +18 -0
- package/dist/manage/ios.js +42 -256
- package/dist/observe/android/context.js +1 -0
- package/dist/observe/android/current-screen.js +55 -0
- package/dist/observe/android/fingerprint.js +13 -0
- package/dist/observe/android/log-stream.js +132 -0
- package/dist/observe/android/logs.js +107 -0
- package/dist/observe/android/screenshot.js +70 -0
- package/dist/observe/android/ui-tree.js +107 -0
- package/dist/observe/android.js +16 -520
- package/dist/observe/evidence.js +114 -75
- package/dist/observe/index.js +16 -263
- package/dist/observe/ios/context.js +16 -0
- package/dist/observe/ios/fingerprint.js +12 -0
- package/dist/observe/ios/log-stream.js +105 -0
- package/dist/observe/ios/logs.js +168 -0
- package/dist/observe/ios/screenshot.js +22 -0
- package/dist/observe/ios/ui-elements.js +241 -0
- package/dist/observe/ios/ui-tree.js +137 -0
- package/dist/observe/ios.js +17 -715
- package/dist/observe/logs/model.js +1 -0
- package/dist/{network → observe/network}/index.js +2 -2
- package/dist/observe/readiness-service.js +4 -2
- package/dist/observe/readiness.js +29 -10
- package/dist/observe/screenshot-encoding.js +41 -0
- package/dist/observe/snapshot-collection.js +79 -0
- package/dist/observe/snapshot-logs.js +30 -0
- package/dist/observe/snapshot-metadata.js +43 -31
- package/dist/observe/snapshot-semantic.js +115 -0
- package/dist/observe/system-trace.js +22 -13
- package/dist/runtime/action-results.js +270 -0
- package/dist/runtime/clock.js +4 -0
- package/dist/server/common.js +1 -256
- package/dist/server/definitions/assert.js +162 -0
- package/dist/server/definitions/diagnostic.js +118 -0
- package/dist/server/definitions/input.js +274 -0
- package/dist/server/definitions/manage.js +194 -0
- package/dist/server/definitions/observe.js +149 -0
- package/dist/server/definitions/target.js +138 -0
- package/dist/server/definitions/wait.js +105 -0
- package/dist/server/handlers/action-execution.js +163 -0
- package/dist/server/handlers/correlation.js +23 -0
- package/dist/server/{debugger-handlers.js → handlers/debugger-handlers.js} +22 -12
- package/dist/server/handlers/debugger-response.js +9 -0
- package/dist/server/handlers/diagnostic.js +69 -0
- package/dist/server/handlers/handler-types.js +1 -0
- package/dist/server/handlers/input.js +154 -0
- package/dist/server/handlers/interact.js +113 -0
- package/dist/server/handlers/journey-assertions.js +35 -0
- package/dist/server/handlers/journey.js +147 -0
- package/dist/server/handlers/manage.js +119 -0
- package/dist/server/handlers/observe.js +95 -0
- package/dist/server/handlers/payload.js +4 -0
- package/dist/server/handlers/tool-handlers.js +160 -0
- package/dist/server/schemas/condition-schema.js +2 -0
- package/dist/server/{debugger-schema.js → schemas/debugger-schema.js} +11 -6
- package/dist/server/{journey-schema.js → schemas/journey-schema.js} +7 -22
- package/dist/server/tool-definitions.js +58 -1135
- package/dist/server-core.js +2 -2
- package/dist/system/android-status.js +101 -0
- package/dist/system/android.js +37 -27
- package/dist/system/index.js +13 -439
- package/dist/system/ios-status.js +132 -0
- package/dist/system/ios.js +11 -8
- package/dist/system/model.js +1 -0
- package/dist/system/probes.js +105 -0
- package/dist/system/status-summary.js +43 -0
- package/dist/system/unsupported-status.js +52 -0
- package/dist/utils/android/commands.js +89 -0
- package/dist/utils/android/gradle.js +139 -0
- package/dist/utils/android/logs.js +103 -0
- package/dist/utils/android/ui-tree.js +233 -0
- package/dist/utils/android/utils.js +6 -564
- package/dist/utils/cli/idb/idb-helper.js +4 -6
- package/dist/utils/cli/idb/install-idb.js +13 -9
- package/dist/utils/cli/ios/preflight-ios.js +42 -38
- package/dist/utils/ios/utils.js +45 -46
- package/dist/utils/java.js +65 -49
- package/dist/utils/resolve-device.js +4 -2
- package/dist/utils/ui/index.js +26 -26
- package/docs/CHANGELOG.md +44 -0
- package/docs/README.md +38 -0
- package/docs/benchmarks/README.md +18 -0
- package/docs/benchmarks/interaction-latency/README.md +14 -0
- package/docs/benchmarks/interaction-latency/final.md +4 -1
- package/docs/benchmarks/interaction-latency/ios-validation.md +2 -0
- package/docs/benchmarks/ui-tree-performance/README.md +24 -16
- package/docs/benchmarks/ui-tree-performance/comparison.md +11 -10
- package/docs/code-structure.md +118 -0
- package/docs/specs/001-state-verification/spec.md +16 -14
- package/docs/specs/002-richer-element-identity/spec.md +12 -10
- package/docs/specs/003-wait-and-synchronization-reliability/spec.md +12 -10
- package/docs/specs/004-action-verification-routing/spec.md +3 -3
- package/docs/specs/005-unified-action-execution-and-verification-model/spec.md +2 -0
- package/docs/specs/006-runtime-action-instrumentation-and-binding-layer/spec.md +2 -0
- package/docs/specs/007-actionability-resolution-and-executable-target-selection/spec.md +3 -1
- package/docs/specs/008-adjustable-control-support-and-semantic-value-manipulation/spec.md +3 -4
- package/docs/specs/009-semantic-control-modeling-for-custom-and-composite-controls/spec.md +2 -0
- package/docs/specs/010-verification-stabilization-and-temporal-convergence/spec.md +2 -2
- package/docs/specs/011-recovery-and-replanning-for-failed-or-ambiguous-interaction-flows/spec.md +2 -2
- package/docs/specs/011.1-recovery-contract-types-and-runtime-wiring-spec/spec.md +2 -0
- package/docs/specs/012-action-trace-and-xecution-observability/spec.md +2 -3
- package/docs/specs/013-wait-and-synchronization-reliability/spec.md +19 -19
- package/docs/specs/014-actionability-resolution/spec.md +20 -18
- package/docs/specs/015-adjustable-control-support/spec.md +17 -15
- package/docs/specs/016-environment-tools/spec.md +20 -20
- package/docs/specs/018-interaction-latency-and-batched-journeys/spec.md +2 -0
- package/docs/specs/019-ui-tree-observation-performance/spec.md +3 -1
- package/docs/specs/020-conditional-actions/intent.md +5 -3
- package/docs/specs/020-conditional-actions/plan.md +8 -9
- package/docs/specs/020-conditional-actions/spec.md +4 -2
- package/docs/specs/021-app-readiness-signals/intent.md +4 -2
- package/docs/specs/021-app-readiness-signals/plan.md +7 -6
- package/docs/specs/021-app-readiness-signals/spec.md +3 -1
- package/docs/specs/022-correlated-evidence/intent.md +4 -4
- package/docs/specs/022-correlated-evidence/plan.md +10 -11
- package/docs/specs/022-correlated-evidence/spec.md +3 -1
- package/docs/specs/023-android-system-traces/intent.md +3 -2
- package/docs/specs/023-android-system-traces/plan.md +5 -7
- package/docs/specs/023-android-system-traces/spec.md +3 -1
- package/docs/specs/024-android-heap-dump-capture/intent.md +3 -1
- package/docs/specs/025-android-runtime-debugger/intent.md +4 -3
- package/docs/specs/025-android-runtime-debugger/plan.md +3 -1
- package/docs/specs/025-android-runtime-debugger/spec.md +4 -3
- package/docs/specs/026-code-structure-and-quality-gates/health-plan.md +88 -0
- package/docs/specs/026-code-structure-and-quality-gates/intent.md +47 -0
- package/docs/specs/026-code-structure-and-quality-gates/plan.md +191 -0
- package/docs/specs/026-code-structure-and-quality-gates/spec.md +138 -0
- package/docs/specs/026-code-structure-and-quality-gates/verification-final.json +200 -0
- package/docs/specs/026-code-structure-and-quality-gates/verification-thin-facade.json +154 -0
- package/docs/specs/026-code-structure-and-quality-gates/verification.json +136 -0
- package/docs/specs/027-debugger-failure-diagnostics/intent.md +43 -0
- package/docs/specs/027-debugger-failure-diagnostics/plan.md +86 -0
- package/docs/specs/027-debugger-failure-diagnostics/spec.md +133 -0
- package/docs/specs/028-compact-debugger-responses/intent.md +41 -0
- package/docs/specs/028-compact-debugger-responses/plan.md +112 -0
- package/docs/specs/028-compact-debugger-responses/spec.md +108 -0
- package/docs/specs/029-kotlin-locals-validation/report.md +119 -0
- package/docs/specs/030-android-coroutine-validation/evidence.json +475 -0
- package/docs/specs/030-android-coroutine-validation/intent.md +47 -0
- package/docs/specs/030-android-coroutine-validation/plan.md +147 -0
- package/docs/specs/030-android-coroutine-validation/report.md +240 -0
- package/docs/specs/030-android-coroutine-validation/spec.md +107 -0
- package/docs/tools/TOOLS.md +31 -18
- package/docs/tools/{evidence.md → correlated-evidence.md} +9 -1
- package/docs/tools/debugger.md +76 -0
- package/docs/tools/interact.md +42 -20
- package/docs/tools/manage.md +25 -44
- package/docs/tools/observe.md +55 -23
- package/docs/tools/system-traces.md +9 -1
- package/docs/tools/system.md +12 -5
- package/package.json +11 -8
- package/scripts/architecture-graph.mjs +69 -0
- package/scripts/check-architecture.mjs +47 -0
- package/scripts/code-quality-baseline.json +1 -0
- package/scripts/code-quality.mjs +161 -0
- package/src/contracts/execution-controls.ts +26 -0
- package/src/contracts/selector.ts +17 -0
- package/src/contracts/target.ts +19 -0
- package/src/contracts/ui.ts +94 -0
- package/src/debugger/android.ts +2 -1
- package/src/debugger/diagnostics.ts +43 -0
- package/src/debugger/guard.ts +6 -1
- package/{worker → src/debugger/java}/DebuggerWorker.java +9 -3
- package/src/debugger/protocol.ts +37 -0
- package/src/debugger/sessions.ts +314 -155
- package/src/debugger/worker.ts +51 -38
- package/src/interact/adjustment/adjustment-context.ts +83 -0
- package/src/interact/adjustment/adjustment-gestures.ts +48 -0
- package/src/interact/adjustment/adjustment-plan.ts +23 -0
- package/src/interact/adjustment/adjustment-resolution.ts +104 -0
- package/src/interact/adjustment/adjustment-result.ts +34 -0
- package/src/interact/adjustment/adjustment-semantic.ts +53 -0
- package/src/interact/adjustment/adjustment-verification.ts +60 -0
- package/src/interact/adjustment/adjustment.ts +49 -0
- package/src/interact/adjustment/control-geometry.ts +120 -0
- package/src/interact/adjustment/control-values.ts +141 -0
- package/src/interact/adjustment/slider-labels.ts +84 -0
- package/src/interact/assertions/screen-assertion.ts +39 -0
- package/src/interact/assertions/state-assertion-context.ts +48 -0
- package/src/interact/assertions/state-assertion.ts +64 -0
- package/src/interact/assertions/state-comparison.ts +168 -0
- package/src/interact/assertions/visibility-assertion.ts +41 -0
- package/src/interact/conditional-action.ts +18 -12
- package/src/interact/index.ts +76 -3492
- package/src/interact/input-service.ts +11 -0
- package/src/interact/interaction-trace.ts +36 -0
- package/src/interact/model.ts +109 -0
- package/src/interact/observation.ts +7 -0
- package/src/interact/targeting/candidate-ancestor.ts +49 -0
- package/src/interact/targeting/candidate-result.ts +24 -0
- package/src/interact/targeting/candidate-scoring.ts +42 -0
- package/src/interact/targeting/element-helpers.ts +243 -0
- package/src/interact/targeting/find-element.ts +47 -0
- package/src/interact/targeting/nearby-control.ts +46 -0
- package/src/interact/targeting/resolved-elements.ts +20 -0
- package/src/interact/targeting/tap-target.ts +22 -0
- package/src/interact/targeting/target-scope.ts +121 -0
- package/src/interact/waits/legacy-log-wait.ts +30 -0
- package/src/interact/waits/legacy-wait-observations.ts +55 -0
- package/src/interact/waits/legacy-wait-state.ts +48 -0
- package/src/interact/waits/legacy-wait.ts +34 -0
- package/src/interact/waits/screen-wait.ts +37 -0
- package/src/interact/waits/ui-change-helpers.ts +184 -0
- package/src/interact/waits/ui-change-state.ts +26 -0
- package/src/interact/waits/ui-change-wait.ts +59 -0
- package/src/interact/waits/ui-wait-condition.ts +52 -0
- package/src/interact/waits/ui-wait-state.ts +55 -0
- package/src/interact/waits/ui-wait.ts +84 -0
- package/src/manage/android.ts +56 -50
- package/src/manage/index.ts +63 -93
- package/src/manage/ios/build-types.ts +14 -0
- package/src/manage/ios/build.ts +230 -0
- package/src/manage/ios/project-discovery.ts +26 -0
- package/src/manage/ios/scheme.ts +16 -0
- package/src/manage/ios.ts +65 -298
- package/src/observe/android/context.ts +1 -0
- package/src/observe/android/current-screen.ts +63 -0
- package/src/observe/android/fingerprint.ts +13 -0
- package/src/observe/android/log-stream.ts +127 -0
- package/src/observe/android/logs.ts +110 -0
- package/src/observe/android/screenshot.ts +79 -0
- package/src/observe/android/ui-tree.ts +113 -0
- package/src/observe/android.ts +17 -531
- package/src/observe/evidence.ts +122 -70
- package/src/observe/index.ts +24 -286
- package/src/observe/ios/context.ts +22 -0
- package/src/observe/ios/fingerprint.ts +12 -0
- package/src/observe/ios/log-stream.ts +103 -0
- package/src/observe/ios/logs.ts +179 -0
- package/src/observe/ios/screenshot.ts +26 -0
- package/src/observe/ios/ui-elements.ts +266 -0
- package/src/observe/ios/ui-tree.ts +143 -0
- package/src/observe/ios.ts +18 -749
- package/src/observe/logs/model.ts +11 -0
- package/src/{network → observe/network}/index.ts +2 -2
- package/src/observe/readiness-service.ts +5 -3
- package/src/observe/readiness.ts +39 -18
- package/src/observe/screenshot-encoding.ts +32 -0
- package/src/observe/snapshot-collection.ts +69 -0
- package/src/observe/snapshot-logs.ts +26 -0
- package/src/observe/snapshot-metadata.ts +51 -31
- package/src/observe/snapshot-semantic.ts +153 -0
- package/src/observe/system-trace.ts +24 -15
- package/src/runtime/action-results.ts +376 -0
- package/src/runtime/clock.ts +9 -0
- package/src/server/common.ts +9 -359
- package/src/server/definitions/assert.ts +164 -0
- package/src/server/definitions/diagnostic.ts +120 -0
- package/src/server/definitions/input.ts +276 -0
- package/src/server/definitions/manage.ts +196 -0
- package/src/server/definitions/observe.ts +151 -0
- package/src/server/definitions/target.ts +140 -0
- package/src/server/definitions/wait.ts +107 -0
- package/src/server/handlers/action-execution.ts +164 -0
- package/src/server/handlers/correlation.ts +20 -0
- package/src/server/handlers/debugger-handlers.ts +39 -0
- package/src/server/handlers/debugger-response.ts +7 -0
- package/src/server/handlers/diagnostic.ts +79 -0
- package/src/server/handlers/handler-types.ts +7 -0
- package/src/server/handlers/input.ts +173 -0
- package/src/server/handlers/interact.ts +135 -0
- package/src/server/handlers/journey-assertions.ts +39 -0
- package/src/server/handlers/journey.ts +132 -0
- package/src/server/handlers/manage.ts +141 -0
- package/src/server/handlers/observe.ts +116 -0
- package/src/server/handlers/payload.ts +36 -0
- package/src/server/handlers/tool-handlers.ts +159 -0
- package/src/server/schemas/condition-schema.ts +2 -0
- package/src/server/{debugger-schema.ts → schemas/debugger-schema.ts} +13 -7
- package/src/server/{journey-schema.ts → schemas/journey-schema.ts} +7 -22
- package/src/server/{system-trace-schema.ts → schemas/system-trace-schema.ts} +3 -3
- package/src/server/tool-definitions.ts +67 -1143
- package/src/server-core.ts +2 -2
- package/src/server.ts +1 -1
- package/src/system/android-status.ts +124 -0
- package/src/system/android.ts +33 -21
- package/src/system/index.ts +21 -525
- package/src/system/ios-status.ts +147 -0
- package/src/system/ios.ts +14 -10
- package/src/system/model.ts +41 -0
- package/src/system/probes.ts +114 -0
- package/src/system/status-summary.ts +47 -0
- package/src/system/unsupported-status.ts +55 -0
- package/src/types.ts +16 -106
- package/src/utils/android/commands.ts +81 -0
- package/src/utils/android/gradle.ts +132 -0
- package/src/utils/android/logs.ts +103 -0
- package/src/utils/android/ui-tree.ts +239 -0
- package/src/utils/android/utils.ts +16 -556
- package/src/utils/cli/idb/check-idb.ts +4 -4
- package/src/utils/cli/idb/idb-helper.ts +6 -8
- package/src/utils/cli/idb/install-idb.ts +15 -9
- package/src/utils/cli/ios/preflight-ios.ts +39 -31
- package/src/utils/cli/ios/run-ios-ui-tree-tap.ts +4 -4
- package/src/utils/ios/utils.ts +57 -61
- package/src/utils/java.ts +62 -43
- package/src/utils/resolve-device.ts +9 -6
- package/src/utils/ui/index.ts +28 -28
- package/test/device/automated/debugger/coroutine-lifecycle.ts +27 -0
- package/test/device/automated/debugger/coroutine-support.ts +140 -0
- package/test/device/automated/debugger/coroutine.android.test.ts +169 -0
- package/test/device/automated/debugger/kotlin.android.test.ts +127 -0
- package/test/device/automated/debugger/runtime.android.test.ts +19 -3
- package/test/device/automated/interact/interaction.android.test.ts +56 -0
- package/test/device/automated/observe/system-trace.smoke.ts +1 -1
- package/test/device/manual/interact/modul8_selector_tap.manual.ts +1 -1
- package/test/fixtures/contracts/tool-definitions.json +3536 -0
- package/test/fixtures/coroutine-app/MainActivity.kt +100 -0
- package/test/fixtures/coroutine-app/README.md +48 -0
- package/test/fixtures/coroutine-app/build.ts +35 -0
- package/test/fixtures/debugger-app/MainActivity.java +21 -0
- package/test/fixtures/debugger-app/MainActivity.kt +32 -0
- package/test/fixtures/debugger-app/README.md +52 -0
- package/test/fixtures/debugger-app/build.ts +25 -15
- package/test/fixtures/latency-journey-app/README.md +2 -0
- package/test/fixtures/readiness-app/README.md +2 -0
- package/test/unit/debugger/coroutine-lifecycle.test.ts +43 -0
- package/test/unit/debugger/diagnostic-sessions.test.ts +67 -0
- package/test/unit/debugger/diagnostics.test.ts +80 -0
- package/test/unit/debugger/guards.test.ts +4 -0
- package/test/unit/debugger/preparation.test.ts +32 -0
- package/test/unit/debugger/protocol.test.ts +15 -0
- package/test/unit/debugger/sessions.test.ts +1 -1
- package/test/unit/interact/adjustment_service.test.ts +42 -0
- package/test/unit/interact/adjustment_verification.test.ts +35 -0
- package/test/unit/interact/clock_dependencies.test.ts +63 -0
- package/test/unit/interact/element_helpers.test.ts +19 -0
- package/test/unit/interact/legacy_wait_service.test.ts +17 -0
- package/test/unit/interact/state_comparison.test.ts +20 -0
- package/test/unit/interact/target_scope.test.ts +35 -0
- package/test/unit/network/get_network_activity.test.ts +1 -1
- package/test/unit/observe/screenshot-encoding.test.ts +30 -0
- package/test/unit/observe/snapshot-logs.test.ts +14 -0
- package/test/unit/quality/architecture.test.ts +60 -0
- package/test/unit/quality/code-quality.test.ts +58 -0
- package/test/unit/quality/interaction_boundaries.test.ts +24 -0
- package/test/unit/server/conditional_actions.test.ts +1 -1
- package/test/unit/server/conditional_schema.test.ts +2 -2
- package/test/unit/server/debugger-response.test.ts +63 -0
- package/test/unit/server/tool_definitions_parity.test.ts +8 -0
- package/dist/server/tool-handlers.js +0 -1000
- package/docs/ROADMAP.md +0 -646
- package/docs/benchmarks/ui-tree-performance/bridge-probe.json +0 -29
- package/docs/benchmarks/ui-tree-performance/initial-baseline.json +0 -59560
- package/docs/specs/baseline-spec-v0.md +0 -312
- package/docs/specs/mcp-tooling-spec-v1.md +0 -446
- package/src/server/debugger-handlers.ts +0 -29
- package/src/server/tool-handlers.ts +0 -1008
- /package/dist/{server/condition-schema.js → contracts/condition.js} +0 -0
- /package/dist/server/{readiness-schema.js → schemas/readiness-schema.js} +0 -0
- /package/dist/server/{system-trace-schema.js → schemas/system-trace-schema.js} +0 -0
- /package/src/{server/condition-schema.ts → contracts/condition.ts} +0 -0
- /package/src/server/{readiness-schema.ts → schemas/readiness-schema.ts} +0 -0
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Read the [development process](docs/specs/process.md) before planning, editing,
|
|
4
|
+
or reviewing a change. Documentation and maintenance use its lightweight path;
|
|
5
|
+
new capabilities and material contract changes require intent and specification
|
|
6
|
+
approval. Automated contributors also start with [AGENTS.md](AGENTS.md).
|
|
7
|
+
|
|
8
|
+
## Local development
|
|
9
|
+
|
|
10
|
+
Use Node.js 22 or newer and npm. Platform tooling is needed only for the mobile
|
|
11
|
+
operations you exercise; see [requirements and setup](README.md#requirements).
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
npm ci
|
|
15
|
+
npm run build
|
|
16
|
+
npm start
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The TypeScript entrypoint is [src/server.ts](src/server.ts); registration and
|
|
20
|
+
dispatch live in [src/server-core.ts](src/server-core.ts) and [src/server/](src/server/).
|
|
21
|
+
The optional Java debugger bridge lives in
|
|
22
|
+
[src/debugger/java/](src/debugger/java/). It is shipped as source and compiled
|
|
23
|
+
on demand by the debugger; the TypeScript build does not compile Java.
|
|
24
|
+
|
|
25
|
+
Platform operations are grouped under `src/manage/`, `src/interact/`,
|
|
26
|
+
`src/observe/`, `src/debugger/`, and `src/system/`, with shared helpers in `src/utils/`.
|
|
27
|
+
|
|
28
|
+
## Validation
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
npm run verify
|
|
32
|
+
npm run test:device
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
`verify` runs lint, the TypeScript build, automated unit tests, and plugin
|
|
36
|
+
consistency checks. Run applicable device checks for native or runtime changes;
|
|
37
|
+
record which devices and behaviours actually ran. See the [process verification
|
|
38
|
+
requirements](docs/specs/process.md#5-verify-and-report) for reporting failures,
|
|
39
|
+
blocked checks, and unrun coverage. Documentation-only work needs diff, relative
|
|
40
|
+
link/path, command, and consistency checks; builds and device tests are unnecessary.
|
|
41
|
+
|
|
42
|
+
Load the [test-authoring skill](.agents/skills/test-authoring/SKILL.md) before
|
|
43
|
+
changing tests, and the [MCP builder skill](.agents/skills/mcp-builder/SKILL.md)
|
|
44
|
+
for installation or native toolchain work. Automated unit tests belong in
|
|
45
|
+
`test/unit/`, automated device tests in `test/device/automated/`, and manual
|
|
46
|
+
helpers in `test/device/manual/`.
|
|
47
|
+
|
|
48
|
+
## Code structure
|
|
49
|
+
|
|
50
|
+
Follow the [code structure and quality checks](docs/code-structure.md) for module
|
|
51
|
+
ownership, enforced limits, and review of legacy exceptions. `npm run lint`
|
|
52
|
+
includes ESLint, structural/type limits and ArchUnitTS dependency checks; CI runs
|
|
53
|
+
the same checks. To diagnose a failure, run `npm run check:quality` or
|
|
54
|
+
`npm run check:architecture` separately. Change a rule or reviewed exception only
|
|
55
|
+
with the corresponding design rationale, rather than suppressing the failure.
|
|
56
|
+
|
|
57
|
+
## Documentation conventions
|
|
58
|
+
|
|
59
|
+
Use the [documentation index](docs/README.md) to place new material. Keep one
|
|
60
|
+
page responsible for each contract and link to it from related guides. Keep
|
|
61
|
+
setup in the root README, current tool contracts in `docs/tools/`, design records
|
|
62
|
+
in `docs/specs/`, and measurements in `docs/benchmarks/`.
|
|
63
|
+
|
|
64
|
+
Write guides around a reader's task: explain when to use the page, show a complete
|
|
65
|
+
example where useful, and link to the likely next step. Keep agent usage
|
|
66
|
+
workflows in the existing plugin skill and detailed contracts in the tool
|
|
67
|
+
reference. Avoid duplicating the full navigation on every page; long references
|
|
68
|
+
should offer task-based links to their own sections.
|
|
69
|
+
|
|
70
|
+
Use one descriptive level-one heading per document and a logical heading
|
|
71
|
+
hierarchy. Use relative links for repository files. Explain prerequisites before
|
|
72
|
+
commands and distinguish examples, proposals, and verified behaviour. Keep
|
|
73
|
+
historical approval and verification evidence dated; avoid chat-relative wording,
|
|
74
|
+
agent handoff instructions, transient checkout status, and temporary log paths.
|
|
75
|
+
Do not turn an earlier design decision into a current support or release claim.
|
|
76
|
+
|
|
77
|
+
When usage changes, update the relevant tool reference, README, and changelog.
|
|
78
|
+
When plugin metadata or its server pin changes, run `npm run sync:agent-plugin`
|
|
79
|
+
and `npm run check:agent-plugin`; see the [plugin guide](agent-plugin/README.md).
|
package/README.md
CHANGED
|
@@ -1,56 +1,138 @@
|
|
|
1
1
|
# Mobile Debug Tools
|
|
2
2
|
[](https://www.npmjs.com/package/mobile-debug-mcp)
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
Build, install, control, and inspect Android and iOS apps from an MCP-compatible
|
|
5
|
+
client. Mobile Debug Tools connects your client to local device toolchains and
|
|
6
|
+
provides UI actions, screenshots, logs, state assertions, and optional Android
|
|
7
|
+
performance capture and runtime debugging.
|
|
8
|
+
|
|
9
|
+
Android, iOS, and Kotlin Multiplatform projects are supported. Flutter and React
|
|
10
|
+
Native have not been tested. Platform and device limitations are described in the
|
|
11
|
+
[tool reference](docs/tools/TOOLS.md).
|
|
12
|
+
|
|
13
|
+
## What you can use it for
|
|
14
|
+
|
|
15
|
+
Mobile Debug Tools gives a coding agent access to a running app, so development
|
|
16
|
+
can include feedback from the device as well as the source code. For example:
|
|
17
|
+
|
|
18
|
+
- **Build and test a feature.** After adding a settings screen, build and install
|
|
19
|
+
the app, navigate to it, and check that its controls display and behave as
|
|
20
|
+
expected. See [app management](docs/tools/manage.md) and
|
|
21
|
+
[UI interactions and assertions](docs/tools/interact.md).
|
|
22
|
+
- **Check a bug fix or regression.** Reproduce a sequence such as opening a form,
|
|
23
|
+
entering text and submitting it, then verify the resulting screen or control
|
|
24
|
+
state. Repeat the journey after a code change to check the outcome.
|
|
25
|
+
- **Review the UI on a device.** Capture screenshots to inspect layout and visual
|
|
26
|
+
changes, or inspect the UI hierarchy for exposed labels and control state.
|
|
27
|
+
See [observations](docs/tools/observe.md).
|
|
28
|
+
- **Investigate an app failure.** Collect logs, screenshots and a debug snapshot
|
|
29
|
+
around a failing action to understand what happened. [Evidence
|
|
30
|
+
correlation](docs/tools/correlated-evidence.md) links observations to the action.
|
|
31
|
+
- **Investigate Android performance or runtime behaviour.** Capture a
|
|
32
|
+
[Perfetto trace](docs/tools/system-traces.md) during a slow flow, or attach the
|
|
33
|
+
[runtime debugger](docs/tools/debugger.md) to a debuggable app to inspect
|
|
34
|
+
breakpoints, call stacks and locals.
|
|
35
|
+
|
|
36
|
+
## How it works
|
|
37
|
+
|
|
38
|
+
Your agent client launches a local MCP server and communicates with it over
|
|
39
|
+
stdio. The server translates tool calls into operations through Android's ADB
|
|
40
|
+
or Apple's Xcode tools and idb, then returns device observations and action
|
|
41
|
+
results to the client. It connects to emulators, simulators and supported
|
|
42
|
+
physical devices through those toolchains.
|
|
43
|
+
|
|
44
|
+
The agent plugin bundles the server configuration and usage skill. The same
|
|
45
|
+
server can also be configured directly in an MCP client or run from a source
|
|
46
|
+
checkout. See [code structure](docs/code-structure.md#module-ownership) for the
|
|
47
|
+
implementation's module boundaries.
|
|
48
|
+
|
|
49
|
+
## Start here
|
|
50
|
+
|
|
51
|
+
Choose how to connect:
|
|
52
|
+
|
|
53
|
+
1. **[Agent plugin](#agent-plugin) — Recommended.** Installs the server configuration
|
|
54
|
+
and usage skill together for supported agent clients.
|
|
55
|
+
2. **[Direct MCP configuration](#mcp-configuration).** Connect the published server
|
|
56
|
+
to another MCP-compatible client.
|
|
57
|
+
3. **[Manual setup](#manual-setup).** Build and run a local source checkout.
|
|
58
|
+
|
|
59
|
+
Check the [requirements](#requirements) for your platform before installing.
|
|
5
60
|
|
|
6
|
-
|
|
7
|
-
> * KMP
|
|
8
|
-
> * Android
|
|
9
|
-
> * iOS
|
|
10
|
-
> * Flutter - not tested
|
|
11
|
-
> * React native - not tested
|
|
61
|
+
## Requirements
|
|
12
62
|
|
|
13
|
-
|
|
14
|
-
|
|
63
|
+
- Node.js >= 22
|
|
64
|
+
- [Android SDK](https://developer.android.com/studio) (adb) for Android support
|
|
65
|
+
- Xcode and its command-line tools on macOS for iOS support
|
|
66
|
+
- [idb](https://github.com/facebook/idb) for iOS UI inspection and interaction
|
|
67
|
+
- JDK 17+ for optional [Android runtime debugging](docs/tools/debugger.md)
|
|
15
68
|
|
|
16
|
-
|
|
17
|
-
and return local Perfetto artifacts with explicit correlation metadata.
|
|
69
|
+
## Agent plugin
|
|
18
70
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
71
|
+
The preferred setup for supported agent clients is the
|
|
72
|
+
[agent plugin](agent-plugin/README.md). It installs the MCP server configuration
|
|
73
|
+
and usage skill together. Choose your client below.
|
|
22
74
|
|
|
23
|
-
|
|
75
|
+
<details>
|
|
24
76
|
|
|
25
|
-
|
|
26
|
-
- [Android SDK](https://developer.android.com/studio) (adb) for Android support
|
|
27
|
-
- Xcode command-line tools for iOS support
|
|
28
|
-
- [idb](https://github.com/facebook/idb) for iOS device support
|
|
77
|
+
<summary>Codex plugin</summary>
|
|
29
78
|
|
|
30
|
-
|
|
79
|
+
Install the plugin from this repository's marketplace:
|
|
31
80
|
|
|
32
|
-
|
|
81
|
+
```bash
|
|
82
|
+
codex plugin marketplace add clivejefferies/mobile-debug-tools
|
|
83
|
+
codex plugin add mobile-debug-tools@mobile-debug-tools
|
|
84
|
+
```
|
|
33
85
|
|
|
34
|
-
|
|
35
|
-
- you have multiple SDKs installed
|
|
36
|
-
- the tools live outside standard locations
|
|
37
|
-
- you want deterministic setup across machines
|
|
38
|
-
- automatic discovery does not find the expected binary
|
|
86
|
+
</details>
|
|
39
87
|
|
|
40
|
-
|
|
41
|
-
- the tools are already on `PATH`
|
|
42
|
-
- the standard Android and Xcode locations are enough
|
|
88
|
+
<details>
|
|
43
89
|
|
|
44
|
-
|
|
45
|
-
- `ADB_PATH`: explicit path to `adb`
|
|
46
|
-
- `ANDROID_SDK_ROOT` or `ANDROID_HOME`: Android SDK root
|
|
47
|
-
- `XCRUN_PATH`: explicit path to `xcrun`
|
|
48
|
-
- `MCP_IDB_PATH` or `IDB_PATH`: explicit path to `idb`
|
|
49
|
-
- `GRADLE_JAVA_HOME` or `JAVA_HOME`: Java home for Gradle-backed operations
|
|
90
|
+
<summary>Claude Code plugin</summary>
|
|
50
91
|
|
|
51
|
-
|
|
92
|
+
Install the plugin from this repository's marketplace:
|
|
52
93
|
|
|
53
|
-
|
|
94
|
+
```bash
|
|
95
|
+
claude plugin marketplace add clivejefferies/mobile-debug-tools
|
|
96
|
+
claude plugin install mobile-debug-tools@mobile-debug-tools
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
</details>
|
|
100
|
+
|
|
101
|
+
<details>
|
|
102
|
+
|
|
103
|
+
<summary>Cursor plugin</summary>
|
|
104
|
+
|
|
105
|
+
The repository includes a [Cursor marketplace](.cursor-plugin/marketplace.json).
|
|
106
|
+
Teams and Enterprise admins can import the repository in Dashboard → Plugins & MCPs → Team
|
|
107
|
+
Marketplaces. To test it locally, copy [agent-plugin](agent-plugin/) into
|
|
108
|
+
`~/.cursor/plugins/local/mobile-debug-tools`, then reload Cursor.
|
|
109
|
+
|
|
110
|
+
</details>
|
|
111
|
+
|
|
112
|
+
Start a new chat or session after installation so the client loads the skill
|
|
113
|
+
and MCP tools. Each plugin launches the published npm package locally and needs
|
|
114
|
+
Node.js 22 or newer and the platform toolchains for your device. If you also
|
|
115
|
+
registered the MCP server directly, disable that registration to avoid
|
|
116
|
+
duplicate tools.
|
|
117
|
+
|
|
118
|
+
## MCP configuration
|
|
119
|
+
|
|
120
|
+
For a standard installation, add this stdio server to your client's MCP settings:
|
|
121
|
+
|
|
122
|
+
```json
|
|
123
|
+
{
|
|
124
|
+
"mcpServers": {
|
|
125
|
+
"mobile-debug": {
|
|
126
|
+
"command": "npx",
|
|
127
|
+
"args": ["--yes", "mobile-debug-mcp"]
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
If your client uses separate fields, choose stdio, set the command to `npx`, and
|
|
134
|
+
supply `--yes` and `mobile-debug-mcp` as arguments. The examples below add optional
|
|
135
|
+
path overrides; replace the placeholder paths before using them.
|
|
54
136
|
|
|
55
137
|
<details>
|
|
56
138
|
|
|
@@ -63,7 +145,7 @@ Recommended when you want Android only, or when you want to make the Android too
|
|
|
63
145
|
"mcpServers": {
|
|
64
146
|
"mobile-debug": {
|
|
65
147
|
"command": "npx",
|
|
66
|
-
"args": ["--yes","mobile-debug-mcp"
|
|
148
|
+
"args": ["--yes", "mobile-debug-mcp"],
|
|
67
149
|
"env": {
|
|
68
150
|
"ADB_PATH": "/path/to/adb",
|
|
69
151
|
"ANDROID_SDK_ROOT": "/path/to/android/sdk",
|
|
@@ -89,7 +171,7 @@ Recommended when you want iOS simulator or device support, or when `idb` lives i
|
|
|
89
171
|
"mcpServers": {
|
|
90
172
|
"mobile-debug": {
|
|
91
173
|
"command": "npx",
|
|
92
|
-
"args": ["--yes","mobile-debug-mcp"
|
|
174
|
+
"args": ["--yes", "mobile-debug-mcp"],
|
|
93
175
|
"env": {
|
|
94
176
|
"XCRUN_PATH": "/usr/bin/xcrun",
|
|
95
177
|
"MCP_IDB_PATH": "/path/to/idb",
|
|
@@ -104,107 +186,52 @@ For iOS-only setups, `ADB_PATH` and `ANDROID_SDK_ROOT` are not required unless y
|
|
|
104
186
|
|
|
105
187
|
</details>
|
|
106
188
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
<summary>Codex</summary>
|
|
110
|
-
|
|
111
|
-
Use STDIO
|
|
112
|
-
|
|
113
|
-
command: npx
|
|
114
|
-
|
|
115
|
-
args:
|
|
116
|
-
* --yes
|
|
117
|
-
* mobile-debug-mcp
|
|
118
|
-
|
|
119
|
-
environment variables:
|
|
120
|
-
* ADB_PATH: /path/to/adb
|
|
121
|
-
* XCRUN_PATH: /usr/bin/xcrun
|
|
122
|
-
* IDB_PATH: /path/to/idb
|
|
123
|
-
* MCP_IDB_PATH: /path/to/idb
|
|
124
|
-
* ANDROID_SDK_ROOT: /path/to/android/sdk
|
|
125
|
-
* GRADLE_JAVA_HOME: /path/to/jdk
|
|
126
|
-
* JAVA_HOME: /path/to/jdk
|
|
127
|
-
|
|
128
|
-
If you are unsure whether the environment is configured correctly, run `get_system_status` first. It reports the detected host, Android, and iOS toolchain state in a structured form.
|
|
129
|
-
|
|
130
|
-
</details>
|
|
131
|
-
|
|
132
|
-
## Agent Plugin
|
|
189
|
+
## Manual setup
|
|
133
190
|
|
|
134
|
-
For
|
|
135
|
-
|
|
136
|
-
|
|
191
|
+
For a local source checkout, follow the [development setup](CONTRIBUTING.md#local-development)
|
|
192
|
+
to install dependencies and build the server. Then configure your MCP client to
|
|
193
|
+
launch that build over stdio:
|
|
137
194
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
</details>
|
|
150
|
-
|
|
151
|
-
<details>
|
|
152
|
-
|
|
153
|
-
<summary>Claude Code plugin</summary>
|
|
154
|
-
|
|
155
|
-
Install the plugin from this repository's marketplace:
|
|
156
|
-
|
|
157
|
-
```bash
|
|
158
|
-
claude plugin marketplace add clivejefferies/mobile-debug-tools
|
|
159
|
-
claude plugin install mobile-debug-tools@mobile-debug-tools
|
|
195
|
+
```json
|
|
196
|
+
{
|
|
197
|
+
"mcpServers": {
|
|
198
|
+
"mobile-debug": {
|
|
199
|
+
"command": "node",
|
|
200
|
+
"args": ["/absolute/path/to/mobile-debug-mcp/dist/server.js"]
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
160
204
|
```
|
|
161
205
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
<details>
|
|
165
|
-
|
|
166
|
-
<summary>Cursor plugin</summary>
|
|
167
|
-
|
|
168
|
-
The repository includes a [Cursor marketplace](.cursor-plugin/marketplace.json).
|
|
169
|
-
Teams and Enterprise admins can import the repository in Dashboard → Plugins & MCPs → Team
|
|
170
|
-
Marketplaces. To test it locally, copy [agent-plugin](agent-plugin/) into
|
|
171
|
-
`~/.cursor/plugins/local/mobile-debug-tools`, then reload Cursor.
|
|
172
|
-
|
|
173
|
-
</details>
|
|
174
|
-
|
|
175
|
-
Start a new chat or session after installation so the client loads the skill
|
|
176
|
-
and MCP tools. Each plugin launches the published npm package locally and needs
|
|
177
|
-
Node.js 18 or newer and the platform toolchains for your device. If you also
|
|
178
|
-
registered the MCP server directly, disable that registration to avoid
|
|
179
|
-
duplicate tools.
|
|
206
|
+
Replace the path with your checkout location. Rebuild after source changes.
|
|
180
207
|
|
|
181
|
-
##
|
|
208
|
+
## Environment setup
|
|
182
209
|
|
|
183
|
-
|
|
184
|
-
|
|
210
|
+
The server discovers platform tools from standard locations and `PATH`. Leave
|
|
211
|
+
path overrides unset for a standard installation. Use them for non-standard
|
|
212
|
+
locations, multiple toolchains, or a pinned development environment.
|
|
185
213
|
|
|
186
|
-
|
|
187
|
-
|
|
214
|
+
| Variable | Purpose |
|
|
215
|
+
| --- | --- |
|
|
216
|
+
| `ADB_PATH` | Path to `adb`. |
|
|
217
|
+
| `ANDROID_SDK_ROOT` or `ANDROID_HOME` | Android SDK root. |
|
|
218
|
+
| `XCRUN_PATH` | Path to `xcrun`. |
|
|
219
|
+
| `MCP_IDB_PATH` or `IDB_PATH` | Path to `idb`. |
|
|
220
|
+
| `GRADLE_JAVA_HOME` or `JAVA_HOME` | Java home for Gradle-backed operations. |
|
|
188
221
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
with current UI evidence if the state changed. See
|
|
193
|
-
[conditional actions](docs/tools/interact.md#conditional-actions) for supported
|
|
194
|
-
tools, examples, and the limits of the check.
|
|
222
|
+
After connecting the client, call `get_system_status` to check discovery and
|
|
223
|
+
prerequisites. See [environment diagnostics](docs/tools/system.md) if a toolchain
|
|
224
|
+
or device is unavailable.
|
|
195
225
|
|
|
196
|
-
|
|
226
|
+
Android debugger errors include bounded, sanitized failure classifications and recovery guidance; see the [debugger guide](docs/tools/debugger.md#failure-diagnostics).
|
|
197
227
|
|
|
198
|
-
|
|
199
|
-
state, and `wait_for_app_ready` for a bounded wait. Existing UI waits can opt into
|
|
200
|
-
`requireReady: true`. Results include evidence and uncertainty; see
|
|
201
|
-
[app readiness](docs/tools/observe.md#app-readiness) for limits and examples.
|
|
228
|
+
## Documentation
|
|
202
229
|
|
|
203
|
-
-
|
|
204
|
-
-
|
|
205
|
-
-
|
|
206
|
-
-
|
|
230
|
+
- [Documentation guide](docs/README.md) — find the guide for your task.
|
|
231
|
+
- [Tool reference](docs/tools/TOOLS.md) — inputs, responses, examples, and shared principles.
|
|
232
|
+
- [Contributing](CONTRIBUTING.md) — develop the server and run its checks.
|
|
233
|
+
- [Changelog](docs/CHANGELOG.md) — release history.
|
|
207
234
|
|
|
208
235
|
## License
|
|
209
236
|
|
|
210
|
-
Apache-2.0
|
|
237
|
+
[Apache-2.0](LICENSE)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mobile-debug-tools",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "Mobile app debugging tools and usage guidance for Android and iOS agents.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "mobile-debug-tools contributors"
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"command": "npx",
|
|
13
13
|
"args": [
|
|
14
14
|
"--yes",
|
|
15
|
-
"mobile-debug-mcp@0.
|
|
15
|
+
"mobile-debug-mcp@0.35.0",
|
|
16
16
|
"server"
|
|
17
17
|
]
|
|
18
18
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mobile-debug-tools",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "Mobile app debugging tools and usage guidance for Android and iOS agents.",
|
|
5
5
|
"repository": "https://github.com/clivejefferies/mobile-debug-tools",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mobile-debug-tools",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "Mobile app debugging tools and usage guidance for Android and iOS agents.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "mobile-debug-tools contributors"
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"command": "npx",
|
|
15
15
|
"args": [
|
|
16
16
|
"--yes",
|
|
17
|
-
"mobile-debug-mcp@0.
|
|
17
|
+
"mobile-debug-mcp@0.35.0",
|
|
18
18
|
"server"
|
|
19
19
|
],
|
|
20
20
|
"cwd": "${CURSOR_PLUGIN_ROOT}"
|
package/agent-plugin/.mcp.json
CHANGED
package/agent-plugin/README.md
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
# Mobile Debug MCP agent plugin
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
[Documentation](../docs/README.md) · [Client installation](../README.md#agent-plugin)
|
|
4
|
+
|
|
5
|
+
Use the [client installation instructions](../README.md#agent-plugin) to install
|
|
6
|
+
the plugin. It supports clients with
|
|
7
|
+
both skills and stdio MCP servers. It provides the mobile-debug MCP
|
|
5
8
|
usage skill and launches the published `mobile-debug-mcp` npm package. The
|
|
6
|
-
plugin requires Node.js
|
|
9
|
+
plugin requires Node.js 22 or newer, `npx`, and the platform toolchains needed
|
|
7
10
|
for the devices you want to use. The first launch may need npm registry access.
|
|
8
11
|
The MCP process starts in the client-managed plugin data directory so npm does
|
|
9
12
|
not resolve the source checkout as a local package when installed from this repo.
|
|
10
13
|
|
|
14
|
+
## Versions and maintenance
|
|
15
|
+
|
|
11
16
|
The server is pinned to the published npm version in `mcp.json`. The plugin's
|
|
12
17
|
`plugin.json` version advances independently for guidance-only releases; do not
|
|
13
|
-
change the server pin to an unpublished npm version. The
|
|
14
|
-
|
|
18
|
+
change the server pin to an unpublished npm version. The
|
|
19
|
+
[usage skill](skills/mobile-debug-mcp/SKILL.md) is shared by all three clients. Run
|
|
15
20
|
`npm run sync:agent-plugin` after updating the plugin metadata or server pin to
|
|
16
21
|
refresh the thin Codex, Claude Code, and Cursor manifests in this directory.
|
|
17
22
|
The three marketplaces all point here and share one skill.
|
|
@@ -19,6 +24,11 @@ The packaged directory uses the skill's declared name, `mobile-debug-mcp`, as
|
|
|
19
24
|
required by Agent Skills. `npm run check:agent-plugin` checks the packaged
|
|
20
25
|
copies and configuration.
|
|
21
26
|
|
|
27
|
+
## Using the plugin
|
|
28
|
+
|
|
29
|
+
After installation, the [usage skill](skills/mobile-debug-mcp/SKILL.md) guides the
|
|
30
|
+
agent through device selection, observation, interaction and verification.
|
|
31
|
+
|
|
22
32
|
The usage skill prefers screenshots for routine visual checks and reserves
|
|
23
33
|
hierarchy reads for semantic selection and structured assertions. Assertion
|
|
24
34
|
timeouts must cover a fresh tree read as well as the expected app transition.
|
|
@@ -30,4 +40,4 @@ updating the skill does not update the pinned server or installed plugin.
|
|
|
30
40
|
If you already configured the MCP server directly in your agent client, disable
|
|
31
41
|
that separate registration when enabling this plugin to avoid duplicate tools.
|
|
32
42
|
The direct npm installation remains available without this plugin. See the
|
|
33
|
-
repository README for platform toolchain setup and `get_system_status` guidance.
|
|
43
|
+
[repository README](../README.md#environment-setup) for platform toolchain setup and `get_system_status` guidance.
|
package/agent-plugin/mcp.json
CHANGED
package/agent-plugin/plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
3
|
"name": "mobile-debug-tools",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.4",
|
|
5
5
|
"description": "Mobile app debugging tools and usage guidance for Android and iOS agents.",
|
|
6
6
|
"repository": "https://github.com/clivejefferies/mobile-debug-tools",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -161,6 +161,13 @@ an older installed server may lack them. This requires JDK 17+ and a running,
|
|
|
161
161
|
debuggable Android app. iOS and native debugging are unsupported. Keep ordinary
|
|
162
162
|
navigation and UI verification on the existing interaction path.
|
|
163
163
|
|
|
164
|
+
For routine debugger calls, opt into `responseMode: "compact"` to omit repeated
|
|
165
|
+
`device`, `target` and `capabilities`. Default `debug` preserves full output;
|
|
166
|
+
attach, capabilities and state remain full in either mode. Use `get_debugger_state`
|
|
167
|
+
to recover the baseline. Errors, diagnostics, IDs, stop/execution state, limits,
|
|
168
|
+
truncation and cleanup remain available. Compact output is not privacy redaction
|
|
169
|
+
and does not establish execution recovery.
|
|
170
|
+
|
|
164
171
|
1. Call `get_debugger_capabilities` with `platform: "android"`, explicit `deviceId`
|
|
165
172
|
and `appId`. Inspect `supported`, prerequisites and candidate processes. Provide
|
|
166
173
|
`processId` when ambiguous; general system health does not prove attach support.
|
|
@@ -176,12 +183,22 @@ navigation and UI verification on the existing interaction path.
|
|
|
176
183
|
`get_debugger_locals` with `stopId`/`frameId` from the returned frame. Inspection
|
|
177
184
|
is shallow and bounded; check availability and truncation. ART may return
|
|
178
185
|
`EMPTY_OR_UNAVAILABLE_VARIABLE_METADATA`: an empty table does not prove that
|
|
179
|
-
the frame has no locals.
|
|
186
|
+
the frame has no locals. On Kotlin assignment lines, the local may not yet be
|
|
187
|
+
initialized or in its emitted variable scope; compare a stop after assignment
|
|
188
|
+
and compiler metadata before diagnosing a worker defect.
|
|
189
|
+
Values can contain private data; report only what is
|
|
180
190
|
needed for the investigation.
|
|
181
191
|
5. Use `step_debugger` (`kind: into/over/out`) or `resume_debugger` with the current
|
|
182
192
|
`stopId`. Acknowledgement is not proof of a later stop. Discard all old stop,
|
|
183
193
|
thread and frame IDs after execution resumes; acquire fresh IDs from events.
|
|
184
|
-
6.
|
|
194
|
+
6. On operation failure, inspect `error.diagnostic.stage`, `.reason` and `.recovery`
|
|
195
|
+
when present. These are bounded classifications and static guidance, not raw
|
|
196
|
+
worker output or proof of root cause. Capability probes may return ordered
|
|
197
|
+
`diagnostics` (JDK, then target) while retaining `success: true` and
|
|
198
|
+
`supported: false`. Terminal state retains sanitized failure diagnostics.
|
|
199
|
+
Timeout/cancellation can leave execution uncertain: reconcile state and cleanup
|
|
200
|
+
before another state-changing command; never automatically retry attach/step/resume.
|
|
201
|
+
7. Always finish with `detach_debugger`, including after failed investigations.
|
|
185
202
|
Inspect `cleanup.status`; retry incomplete detach rather than starting another
|
|
186
203
|
session. Use `get_debugger_state` to reconcile an uncertain command outcome;
|
|
187
204
|
do not automatically repeat attach, step or resume.
|
|
@@ -200,6 +217,14 @@ traversal, coroutine reconstruction or heap capture. A successful debugger comma
|
|
|
200
217
|
establishes only its reported execution/inspection evidence, not the visible app
|
|
201
218
|
outcome or the cause of a bug.
|
|
202
219
|
|
|
220
|
+
For Kotlin coroutines, use explicit source breakpoints before and after suspension
|
|
221
|
+
and verify each observed location. Thread-based stepping can stop in generated
|
|
222
|
+
state-machine code; it does not promise to follow a coroutine across dispatchers.
|
|
223
|
+
Inspect compiler line/local metadata when source bindings or values are unclear.
|
|
224
|
+
Shallow locals do not expose spilled continuation fields, suspended coroutine
|
|
225
|
+
inventories, parent/child identities or logical asynchronous stacks. Do not enable
|
|
226
|
+
debug probes or add app instrumentation without a separately agreed design.
|
|
227
|
+
|
|
203
228
|
## Report evidence precisely
|
|
204
229
|
|
|
205
230
|
State the device, actions taken, observed result, evidence source, and any
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const verificationModes = ['none', 'light', 'full'];
|
|
3
|
+
export const responseModes = ['compact', 'debug'];
|
|
4
|
+
export const verificationModeSchema = z.enum(verificationModes);
|
|
5
|
+
export const responseModeSchema = z.enum(responseModes);
|
|
6
|
+
export const verificationModeJson = { type: 'string', enum: [...verificationModes] };
|
|
7
|
+
export const responseModeJson = { type: 'string', enum: [...responseModes] };
|
|
8
|
+
export function interactionControls(args) {
|
|
9
|
+
const verificationMode = (typeof args.verificationMode === 'string' ? args.verificationMode : undefined) ?? 'full';
|
|
10
|
+
const responseMode = (typeof args.responseMode === 'string' ? args.responseMode : undefined) ?? 'debug';
|
|
11
|
+
if (!verificationModes.includes(verificationMode) || !responseModes.includes(responseMode))
|
|
12
|
+
throw new Error('INVALID_ARGUMENT');
|
|
13
|
+
for (const key of ['verificationMode', 'responseMode'])
|
|
14
|
+
if (args[key] !== undefined && typeof args[key] !== 'string')
|
|
15
|
+
throw new Error('INVALID_ARGUMENT');
|
|
16
|
+
for (const key of ['actionTimeoutMs', 'verificationTimeoutMs'])
|
|
17
|
+
if (args[key] !== undefined && (typeof args[key] !== 'number' || !Number.isInteger(args[key])))
|
|
18
|
+
throw new Error('INVALID_ARGUMENT');
|
|
19
|
+
const actionTimeoutMs = (typeof args.actionTimeoutMs === 'number' && Number.isFinite(args.actionTimeoutMs) ? args.actionTimeoutMs : undefined);
|
|
20
|
+
const verificationTimeoutMs = (typeof args.verificationTimeoutMs === 'number' && Number.isFinite(args.verificationTimeoutMs) ? args.verificationTimeoutMs : undefined);
|
|
21
|
+
return { verificationMode, responseMode,
|
|
22
|
+
actionTimeoutMs: actionTimeoutMs === undefined ? undefined : Math.max(100, Math.min(30000, actionTimeoutMs)),
|
|
23
|
+
verificationTimeoutMs: verificationTimeoutMs === undefined ? 3000 : Math.max(100, Math.min(60000, verificationTimeoutMs)) };
|
|
24
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const selectorSchema = z.object({
|
|
3
|
+
text: z.string().min(1).optional(), resource_id: z.string().min(1).optional(),
|
|
4
|
+
accessibility_id: z.string().min(1).optional(), contains: z.boolean().optional()
|
|
5
|
+
}).strict().refine(value => !!(value.text || value.resource_id || value.accessibility_id), 'Selector requires a target');
|
|
6
|
+
export const selectorJson = { type: 'object', additionalProperties: false, properties: {
|
|
7
|
+
text: { type: 'string', minLength: 1 }, resource_id: { type: 'string', minLength: 1 }, accessibility_id: { type: 'string', minLength: 1 }, contains: { type: 'boolean' }
|
|
8
|
+
}, anyOf: ['text', 'resource_id', 'accessibility_id'].map(key => ({ required: [key] })) };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { selectorSchema as selector, selectorJson } from './selector.js';
|
|
3
|
+
const pollIntervalMs = z.number().int().min(50).max(1000).optional();
|
|
4
|
+
export const waitForSchema = z.object({
|
|
5
|
+
condition: z.enum(['exists', 'visible', 'clickable']).optional(),
|
|
6
|
+
timeoutMs: z.number().int().min(100).max(10000).optional(), pollIntervalMs,
|
|
7
|
+
match: z.object({ index: z.number().int().nonnegative().optional() }).strict().optional()
|
|
8
|
+
}).strict();
|
|
9
|
+
export const targetFields = { selector: selector.optional(), elementId: z.string().min(1).optional() };
|
|
10
|
+
export const exactlyOneTarget = (value) => Number(!!value.selector) + Number(!!value.elementId) === 1;
|
|
11
|
+
export const tapElementControlsSchema = z.object({
|
|
12
|
+
elementId: z.string().min(1).optional(), selector: selector.optional(), waitFor: waitForSchema.optional()
|
|
13
|
+
}).strict().refine(value => Number(!!value.elementId) + Number(!!value.selector) === 1 && (!value.elementId || !value.waitFor));
|
|
14
|
+
export const targetJson = { selector: selectorJson, elementId: { type: 'string', minLength: 1 } };
|
|
15
|
+
export const oneTargetJson = [{ required: ['selector'], not: { required: ['elementId'] } }, { required: ['elementId'], not: { required: ['selector'] } }];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|