Repository navigation
fix(wda): a first launch behind the privacy notice returns at once - #148
Merged
Merged
Conversation
The first time a system app such as Notes or Reminders is opened, iOS shows its privacy notice in a separate process (com.apple.PDUIApp) on top of it. /wda/apps/launch waits until XCTest sees the app in the foreground, so it waited the full 60 s, the call failed with a timeout, and the daemon then judged WDA stalled and restarted it: 65 s and a WDA restart for one iphone_launch_app. Launch with /wda/apps/launchUnattached instead, which goes through LSApplicationWorkspace and returns at once, and keep polling the foreground as before. When the foreground is the privacy notice, report it as blocking, like a permission alert. In this state the route answers "failed to launch" although the notice is up, so that answer is treated like a successful launch and the foreground decides. An older WDA without the route falls back to /wda/apps/launch. On an iPhone 12 mini (iOS 26.4.1) launching a never-opened Notes now returns in 0.7 s without a WDA restart; 0.2.7 took 65 s and restarted WDA. Regression case Derrors#152. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
12 of 13 tasks
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>
This was referenced 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>
Bring in Derrors#150: its CHANGELOG line and regression row Derrors#152 come before this branch's line and row Derrors#153. 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>
Derrors
added a commit
to cosinec/iphone-control
that referenced
this pull request
Nov 17, 2026
Bring in Derrors#148: its CHANGELOG line and regression row Derrors#153 come before this branch's line and row Derrors#154. 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
The first time a system app such as Notes or Reminders is opened, iOS shows its privacy notice ("Welcome to Notes … Accept & Continue") in a separate process,
com.apple.PDUIApp, on top of the app./wda/apps/launchwaits until XCTest sees the app in the foreground, so it waits the full 60 s and times out. The daemon then counts the stuck requests and restarts WDA. Oneiphone_launch_appcosts 65 s, an error, and a WDA restart, and the agent is told to take a screenshot first. I hit it twice in one session (Reminders, Notes). It is reproduced below on v0.2.7.Fix in
WdaClient::launch_app:/wda/apps/launchUnattached. It exists in the pinned WDA v16.15.3, goes throughLSApplicationWorkspacewithout XCTest, and returns at once (0.05–0.3 s). Then the existing loop polls/wda/activeAppInfoas before.unknown error: LSApplicationWorkspace failed to launch appeven though the notice is already up, so that answer is treated as launched and the foreground decides.com.apple.PDUIApp: the loop returnsLaunch::Blockedright away with a description of the notice. The daemon's existing wording for a blocking alert applies (已启动 …,但屏幕上有系统弹窗「第一次打开时的隐私说明页(…)」挡着;先用 iphone_tap_element 点弹窗上的按钮), andOutcome.blockedis set as for permission alerts.unknown command/unknown method/ HTTP 404/405, the same testinterface_rotationuses), it falls back to/wda/apps/launch. Any other error is still returned as an error.The settle after reaching the foreground (
settle_launched,LAUNCH_MIN, regression #13) is unchanged. The cold-start "tap right after launch" case is re-checked on the device below. Native control (iOS 27,native_launch) andopen_urlare not touched.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):a_first_launch_privacy_notice_is_reported_at_once: "failed to launch", then the privacy notice in front, givesBlockedwithin a second, with no/wda/apps/launch.an_older_wda_without_unattached_launch_launches_as_before: a 404unknown commandfalls back to the session launch.other_launch_errors_are_errors#[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): 16 calls, 0 failed, 15.0s in all, includingiphone_launch_app时钟 and the tap right after itrun.py output
3. Regression cases (docs/dev/regression-cases.md)
Blockedpath4. Real-device proof of the fix or feature
launchUnattachedon a real device (covered by the unit test); iPad; native control (unchanged)Steps and results
Notes had never been opened on this phone and was left on its privacy notice (not accepted) between runs.
v0.2.7:
this branch:
No WDA restart in the daemon log during the branch runs.
Checklist
Docs:
CHANGELOG.md,CHANGELOG.zh-CN.md, regression row #152.🤖 Generated with Claude Code