Repository navigation
fix(device): an app that reads no elements restarts a stuck axauditd too - #156
Merged
Merged
Conversation
With native control (iOS 27), axauditd also gets stuck without timing out: the frontmost app reads no elements at all, not even its own application element, on a new session too, while SpringBoard reads as usual. Reading the screen, tapping by text and launching apps then failed with "no screen elements read" until axauditd was ended by hand; restarting the daemon didn't help. Seen once on an iPhone19,7 (iOS 27.2.1); ending axauditd brought the reads back at once. Such a read is now reported as the accessibility service not answering (DeviceError::AxUnanswered, worded as before), which the daemon restarts axauditd for (#152), at most once a minute. The lock screen under the HID screen stream reads one element (#126) and is not taken for it. scenarios.py `url`: #131 also passes when the link opens in the browser the answer names. Natively a web link always opens in Safari; through WDA the system opens the default browser, which failed the check on a phone whose default browser is Chrome. 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
axauditd stuck without a timeout. With native control (iOS 27), axauditd also gets stuck in a way #152 doesn't catch: the frontmost app reads no elements at all, not even its own application element, and a new session reads the same, while SpringBoard reads as usual. Nothing times out, so it isn't
DeviceError::AxUnansweredand axauditd isn't restarted. Reading the screen, tapping by text and launching apps all failed with "读界面失败:超时:没有读到界面元素" (Clock, then Settings after a relaunch). Terminating and relaunching the app didn't help, and neither did restarting the daemon. Ending axauditd by hand (the sameTunnel::restart_ax_daemonthe daemon uses) brought the reads back at once: Settings read 15 elements. This was seen once, on an iPhone19,7 (iOS 27.2.1), and what puts axauditd in this state isn't known.Tunnel::ax_screennow reports such a read (no elements after the reconnect it already does) asDeviceError::AxUnanswered, with the same text as before. The daemon restarts axauditd for it and reads again, at most once a minute (#152). The lock screen under the HID screen stream reads one element, the app's (#126), so it isn't taken for this.scenarios.py url, #131. The check wanted the link in Safari. Natively a web link always opens in Safari (apps::app_for_url). Through WDA the system opens the default browser, so the check failed on a phone whose default browser is Chrome. It now also passes when the link opens in the app the answer names, that app is in front, and it isn't the home screen. The scenario's description says which browser each route uses. Test only, no product code.Tests
1. Unit tests
cargo test --workspace --all-features --locked,cargo clippy --workspace --all-targets --all-features --locked -- -D warningsandcargo fmt --check(per package) passan_app_read_with_no_elements_is_an_unanswered_accessibility_service(the error kind and that its text is unchanged; that the phone reads empty only shows on a device)#[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)tests/device/scenarios.pypasses on this branch: native, all scenarios with--lock --url, 59 checks, 0 failed; WDA,--url url, 3 checks, 0 failedmain, same device, for comparison (run.py --repeat 5 --json,compare.py): not run. The change only matters when a read returns no elements, and over the runs below that never happened, so no other step takes a different pathurlthrough WDA before and afterrun.py output
3. Regression cases (docs/dev/regression-cases.md)
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, native and WDA), fix(daemon): native Home waits out its animation even when the HID session had to be opened #155 (the restart path, via the log)4. Real-device proof of the fix or feature
main, gone with this branch, same device and steps. Not done for the axauditd part: the stuck state can't be brought about on demand, and it hasn't come back since. What was shown on the device:main), ending axauditd throughTunnel::restart_ax_daemonfixed the reads at once. That is what the daemon now does on its ownrun.pyand every scenario (59 checks, three automatic unlocks) the daemon log has no "reads no elements on a new session either" and no "已重启手机上的 axauditd"main'sscenarios.pythrough WDA, passes with this branch's, same daemon, back to backSteps and results (before / after, output, log lines, screenshots)
Checklist
🤖 Generated with Claude Code