Repository navigation
fix(daemon): native Home waits out its animation even when the HID session had to be opened - #155
Merged
Merged
Conversation
…ssion had to be opened With native control (iOS 27), Home on the home screen is answered no sooner than 0.6 s after it was pressed (#130), but the time was taken before the HID session was opened. After the daemon had left the session idle (30 s), opening it again (the screen stream) took about as long, so nothing was waited for, and an app launched right after was sent back to the home screen when the animation ended: 7 times in 8 on an iPhone19,7 (iOS 27.2.1), 0 in 8 with the session already open. It is why run.py's first run after a daemon start failed with "Clock's tab bar isn't among the first 40 elements". The session is now opened first and the wait counted from the press. scenarios.py has a new `idle` scenario for it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 18, 2026
Merged
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
With native control (iOS 27), an app launched right after Home on the home screen could be sent back to the home screen:
iphone_launch_appsaid "Launched com.apple.mobiletimer", the app came to the front, and a moment later SpringBoard was in front again. It is whyrun.py's first run after a daemon start often failed with "Clock's tab bar isn't among the first 40 elements".native_homeanswers no sooner than 0.6 s after Home was pressed when the home screen is already in front (HOME_ANIMATION, #130: what Home closes is still animating, and an app launched meanwhile is sent back when it ends). The time was taken beforehid_do, which first opens the HID session when the daemon has closed it (idle for 30 s,supervise::HID_IDLE). Opening it (the screen stream, a fixed 300 ms, two services) takes about as long as the wait, so nothing was left to wait for.The session is now opened first and the 0.6 s counted from the press. Home on the home screen with the session closed takes about 0.5 s longer for it (about 1.3 s instead of 0.8 s); with the session open nothing changes.
tests/device/scenarios.pyhas a newidlescenario (default, about 2 minutes): it lets the daemon close the idle session, presses Home on the home screen, launches Clock, and checks Clock is still in front 1.5 s later. Regression case #157.Tests
1. Unit tests
cargo test --workspace --all-features --locked,cargo clippy --workspace --all-targets --all-features --locked -- -D warningsandcargo fmt --check(per package) passscenarios.py idle#[ignore]tests of the changed area run by hand: none apply2. Real-device regression
8770ef8with fix(daemon): native unlocking keeps the HID session open until a key tap has landed #154'snative.rs(now121a498, so that the phone unlocks itself): "before" is that alone, "after" adds this change. The rebased branch'scrates/differs from "after" by nothing.tests/device/run.pydefault steps pass on this branch (exit code 0)tests/device/scenarios.pypasses on this branch: all of them,--lock --url(tools, typing, fresh, batch, menu, idle, url, lock): 59 checks, 0 failedrun.py --repeat 5 --json,compare.py); no step clearly slower, or why: total median 15.23 s → 14.96 s.compare.pymarks two steps: the last Home, 1.43 → 1.83 s, and the last status, 0.07 → 0.17 s. The last Home is Home from Spotlight to the home screen, where the 0.6 s now always passes in full: 1.79–1.90 s in all 5 runs here, 1.37–1.91 s before (1.74 and 1.91 in 2 of 5). Why it was sometimes shorter before isn't worked out. The status step is 0.04–0.18 s on both sidesscenarios.py idle; see part 4run.py output
3. Regression cases (docs/dev/regression-cases.md)
scenarios.py menu), 修复:iOS 26 上 Home、锁屏键无效,熄屏时自动解锁唤醒不了 #13 and The daemon always launches WDA in the background; drop ICTL_WDA_DETACHED #125 (fresh), fix(daemon): remember per device which way of locking works #59, fix(viewer): Home from the control page doesn't look for an alert first #102, fix(viewer): the low-bandwidth setting is a switch like the other settings #105, fix(cli):statusshows native control instead of asking for WDA #127, feat(mcp): iphone_swipe holds before moving with hold, to drag icons #144 (lock), fix(setup): a key typed after an unfinished sequence isn't swallowed #131, fix(daemon): a paste over the same selected text isn't reported as failed #133 (url)4. Real-device proof of the fix or feature
Steps and results (before / after, output, log lines, screenshots)
Checklist
🤖 Generated with Claude Code