Repository navigation
feat(mcp): iphone_batch taps a run of keys in one gesture with one_gesture - #143
Merged
Merged
Conversation
…sture A batch of iphone_tap steps waits for the interface to go idle after each tap, so pressing keys one by one (for fields that don't take iphone_type_text) costs about 0.5 s per key. With one_gesture: true the points go out as one W3C actions gesture, one touch pointer per point, each pausing through the earlier points' ticks so the presses come one after another. Any other kind of step makes the batch an error before anything runs; without WDA the points are tapped one by one over HID. On an iPhone 12 mini, 7 digit keys take 1.9 s instead of 3.6 s and 20 take 4.6 s instead of 9.6 s, all read back correctly. Closes Derrors#142 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cosinec
force-pushed
the
feat/batch-one-gesture
branch
from
November 17, 2026 06:09
99c3890 to
76f7ac3
Compare
This was referenced Nov 17, 2026
Resolve the conflicts with Derrors#139 and Derrors#141: keep both sides (TapSequence next to Tap's new count, both constants, both client methods and their tests, CHANGELOG lines, regression rows Derrors#146-Derrors#148 in order). iphone_tap now carries count: a step with count under one_gesture is an error instead of being tapped once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Derrors
added a commit
to cosinec/iphone-control
that referenced
this pull request
Nov 17, 2026
Resolve the conflicts with Derrors#139, Derrors#141 and Derrors#143 by keeping both sides: drag_steps next to tap_sequence_body, the exports of both, the protocol helpers, the MCP tests, CHANGELOG lines and regression rows Derrors#146-Derrors#149 in order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Derrors
added a commit
to cosinec/iphone-control
that referenced
this pull request
Nov 17, 2026
Resolve the conflicts with Derrors#141, Derrors#143 and Derrors#144: keep both sides (Tap's count and TapSequence next to TapElement's scroll, the protocol helpers, the MCP tests, CHANGELOG lines, doc rows with iphone_tap's count and iphone_tap_element's scroll, regression rows Derrors#146-Derrors#149 then Derrors#151). The search scroll now builds the Stroke that Derrors#144's swipe takes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Closes #142. Some text fields (inside in-app web views) don't take
iphone_type_textat any speed, so the only way in is tapping keyboard keys one by one. Iniphone_batcheachiphone_tapwaits for the interface to go idle, about 0.5 s per key: 7 digits take 3.6 s, 20 take 9.6 s.iphone_batchgets an optionalone_gesture(boolean, default false):iphone_tap(by coordinates). The steps become oneRequest::TapSequence { points }. A batch that mixes in any other step (iphone_tap_element,wait,iphone_type_text, …) is an error before anything runs. The result is one line:在一个手势里依次点了 N 个点:(x,y) …/Tapped N points in one gesture: ….WdaClient::tap_sequencesends one/actionsrequest with one touch pointer per point (tap_sequence_body). Pointer k pauses through the earlier points' ticks (move, down, 50 ms press, up,SEQUENCE_GAP_MS= 40 ms), then taps its own point, so the presses come strictly in turn and never overlap. It uses the same no-cool-off idle settings asiphone_tap(quick_gesturenow delegates to aquick_actionsthat takes a raw body). One pointer per point is deliberate: a single pointer that moves between points inside one gesture registered every key twice.Request::TapSequence, at mostMAX_SEQUENCE_POINTS(20, same as a batch) points, counted as mutating and foreground likeTap. An older daemon doesn't know the op and returns an error instead of tapping part of it. An older MCP server ignoresone_gestureand runs the taps one by one (checked with 0.2.7, below), so the parameter is safe either way.Tool names, existing parameters and default output don't change (D10).
Tests
1. Unit tests
cargo test --workspace --all-features --locked,cargo clippy --workspace --all-targets --all-features --locked -- -D warningsandcargo fmt --check(per package) pass (Rust 1.99.1, macOS)ictl-wda:client::tests::a_sequence_is_one_finger_per_point_in_turn. One pointer per point, distinct ids, pointer k pauses for exactly 5 ticks per earlier point, then move/down/press/up at its own point.ictl-mcp:tests::one_gesture_turns_taps_into_one_sequence. Taps become oneTapSequence; a batch withiphone_tap_element,waitoriphone_type_textis an error; without the flag the batch stays step by step.ictl-protocol:tests::requests_round_trip_as_tagged_jsonnow also round-tripstap_sequence.#[ignore]tests of the changed area run by hand: none apply2. Real-device regression
tests/device/run.pydefault steps pass on this branch (exit code 0): 14 calls, 0 failed, 13.1s in allrun.py output
3. Regression cases (docs/dev/regression-cases.md)
iphone_tapstill goes throughquick_gesturewith the same body, and the run.py steps above behave as before4. Real-device proof of the fix or feature
Steps and results
Spotlight search field focused, number keyboard (digit keys at y=548). Before each run the field was cleared through WDA, and afterwards its value was read back. Times are the
iphone_batchcall as seen by the MCP client;oneisone_gesture: true,stepsis the same taps without it.Checklist
Docs:
docs/tools.md,website/guide/tools.md,website/en/guide/tools.md,CHANGELOG.md,CHANGELOG.zh-CN.md.🤖 Generated with Claude Code