Skip to content

Report a stuck accessibility tree instead of timing out - #168

Merged
bitomule merged 1 commit into
mainfrom
worktree-t-mav-161-empty-tree-after-xcuitest
Dec 3, 2026
Merged

bitomule merged 1 commit into
mainfrom
worktree-t-mav-161-empty-tree-after-xcuitest

Conversation

@bitomule

@bitomule bitomule commented Dec 2, 2026

Copy link
Copy Markdown
Owner

Closes #161.

Problem

After an XCUITest runner has driven a simulator, AXe and idb return an empty AXApplication for every app launched afterwards, until the simulator reboots. mav flows then failed with a bare wait_timeout, which reads like a wrong selector.

Change

  • New code ax_tree_stuck_empty, emitted when the accessibility tree is empty while the screen is not blank. The second signal is a fresh screenshot that is not a single flat colour, or baguette's tree still listing elements. A blank screen (splash, launch in progress) keeps the old timeout.
  • Reported by mav ui wait, flow wait / waitUntil / assert steps, the after-input --wait-* path, mav ui tree and mav ui find.
  • The failure carries cause, probe, udid and next= with the exact xcrun simctl shutdown <udid> && xcrun simctl boot <udid> for that simulator.
  • Logic lives in the new internal/mav/axtree_stuck.go; cli.go only gets small call-site changes.
  • README and the mav skill document the code.

Recovery

No recovery short of a reboot is offered: the issue measured that relaunching, reinstalling and calling idb do not bring the tree back, and I could not reproduce the XCUITest state here to test another route. The existing mav ui tree auto-reboot is unchanged. The baguette fallback for reads is not included, since it would still miss id selectors, as the issue notes.

Tests

New tests cover the visible-screen, blank-screen and populated-tree cases for ui wait, a flow wait step and ui tree, plus the image check. With the call-site changes reverted, the three behaviour tests fail; with them they pass. go test ./... passes.

@bitomule
bitomule force-pushed the worktree-t-mav-161-empty-tree-after-xcuitest branch from e0ba1f8 to 2173f09 Compare December 2, 2026 23:50
@bitomule
bitomule force-pushed the worktree-t-mav-161-empty-tree-after-xcuitest branch from 2173f09 to 4f0d659 Compare December 3, 2026 00:12
After an XCUITest run on a simulator, AXe and idb return an empty tree for every app launched afterwards until the simulator reboots. Waits, flow wait steps and ui tree/find now fail with ax_tree_stuck_empty when the tree is empty while the screen is not blank, with the simulator reboot as the way out, instead of a bare wait_timeout.
@bitomule
bitomule force-pushed the worktree-t-mav-161-empty-tree-after-xcuitest branch from 4f0d659 to 1bd9449 Compare December 3, 2026 09:55
@bitomule
bitomule merged commit 12dadba into main Dec 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

After an XCUITest session on a simulator, AXe and idb return an empty tree for every newly launched app until the simulator reboots

1 participant