Repository navigation
feat(mcp): iphone_tap taps the same point several times with count - #141
Merged
Merged
Conversation
This was referenced Nov 17, 2026
Separate taps each wait for the interface to go idle, about 0.5 s apart (iphone_batch: 5 taps in about 2.8 s), so a double tap, or an entry that needs several taps in a short time, couldn't be done: double-tapping the keyboard's Shift only turned it on and off again. iphone_tap takes count (1-10, default 1). Through WDA the taps go in one actions gesture, one finger moving once and tapping the same point MULTI_TAP_GAP_MS (0.1 s) apart; one finger that moves to another point inside a gesture had each tap registered twice. Through HID they go in the same session. count travels in Request::Tap only when it isn't 1, so older daemons see the same requests as before (and ignore it). Regression case Derrors#147. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cosinec
force-pushed
the
feat/tap-count
branch
from
November 17, 2026 06:09
cf16d23 to
afa5bdb
Compare
This was referenced Nov 17, 2026
Resolve the conflict in docs/dev/regression-cases.md: keep Derrors#146 (from Derrors#139) and this branch's Derrors#147, 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#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 conflict in docs/dev/regression-cases.md: rows Derrors#146-Derrors#149 from main, then this branch's Derrors#150. The repeat test's Request::Tap gains the count field Derrors#141 added. 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>
Derrors
added a commit
to cosinec/iphone-control
that referenced
this pull request
Nov 17, 2026
Resolve the conflicts with Derrors#141-Derrors#147: keep both sets of client tests, and rows Derrors#146-Derrors#151 from main. This branch's row becomes Derrors#153 (Derrors#152 goes to the native floating search bar fix, Derrors#150). 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#150: TapElement's dispatch keeps main's scroll search and this branch's clearing of before_action on a miss; CHANGELOG lines after main's; this branch's regression row becomes Derrors#154 (Derrors#152 is Derrors#150's, Derrors#153 is Derrors#148's). 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
Separate taps each wait for the interface to go idle, so they land about 0.5 s apart;
iphone_batchwith 5iphone_tapsteps took about 2.8 s on an iPhone 12 mini. That rules out a double tap and any entry that needs several taps within a short time, for example a hidden debug menu that opens on 5 taps within 800 ms. On the keyboard, tapping Shift twice through two calls only turns it on and off again; Caps Lock never comes on.docs/dev/wda-dependency-research.md§7 already notes that the taps of a double tap have to be in one event path.iphone_tapgets an optionalcount(1-10, default 1):actionsgesture. One finger moves to the point once, then goes down and upcounttimes,MULTI_TAP_GAP_MS(100 ms) apart, with a 50 ms press like a normal tap. 5 taps take 650 ms of gesture time. The same quick idle settings astapare used. I keep it to one point on purpose: on an iPhone 17 (iOS 26.5.2), a single pointer that moved to a different point inside one gesture had every tap registered twice (7 keypad keys gave 14 digits).MULTI_TAP_GAP_MSapart.Request::Tapgetscountwith#[serde(default = 1, skip_serializing_if = 1)]. Requests without it (older clients) mean one tap. Withcount1 the request is byte-for-byte what it was. An older daemon givencount> 1 ignores the field and taps once (verified with 0.2.7, see below), the same as with any new optional field. The CHANGELOG line says so.countin theiphone_tapschema (minimum/maximum). 0, 11, 2.5 or a string is an error, not a silent 1. It works insideiphone_batchtoo. The result says已点击 (x,y),连点 N 下/Tapped (x,y), N times. Whencountis 1 the output is unchanged.The tool name, the existing parameters and the 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::multi_tap_is_one_request_at_one_point. It checks for one/actionsrequest, onepointerMove, 5 downs and 5 ups, and a total duration of5×50 + 4×100ms (< 800).ictl-mcp:tests::tap_count_defaults_to_one_and_rejects_out_of_range, which also covers a batch step.ictl-protocol:tests::a_tap_without_count_is_one_tap_on_the_wire. Old JSON decodes as 1, andcount1 is not serialized.Request::Tap { .. }constructions in tests only gainedcount: 1.#[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, 12.0 shometook 8.2 s, right after WDA had started.run.py output
3. Regression cases (docs/dev/regression-cases.md)
iphone_tapstill goes throughquick_gestureunchanged, and the run.py taps above behave as before4. Real-device proof of the fix or feature
tests/device/run.pywith custom steps), including the error and edge casesSteps and results
Spotlight search field focused, English keyboard. Before each run the field was cleared, and afterwards its value was read through WDA. Each tap on the
wkey types one letter, so the letters count the taps that registered.To show the taps fall inside the system's double-tap window, I tapped the keyboard's Shift (28,660) twice and then typed with
count=3onw. Three rounds each:Checklist
Docs:
docs/tools.md,website/guide/tools.md,website/en/guide/tools.md,CHANGELOG.md,CHANGELOG.zh-CN.md.🤖 Generated with Claude Code