Skip to content

fix(tvos): read the view hierarchy on a physical Apple TV - #12

Open
cocoa-xu wants to merge 2 commits into
plexinc:mainfrom
tv-labs:cocoa/tvos-device-view-hierarchy
Open

cocoa-xu wants to merge 2 commits into
plexinc:mainfrom
tv-labs:cocoa/tvos-device-view-hierarchy

Conversation

@cocoa-xu

Copy link
Copy Markdown

Proposed changes

On a physical Apple TV, every view hierarchy request stopped the driver. The handler queried the home screen (com.apple.HeadBoard) for status bars and for the device frame, but a physical Apple TV's home screen answers only while it is in the foreground, so the status bar query failed (kAXErrorServerNotFound, or Timed out while evaluating UI query) and took the driver down with it.

On tvOS the handler now skips the status bars, which tvOS does not have, and takes the device frame from the foreground app. iOS is unchanged.

Testing

I built the tvOS driver twice, once from this branch and once from main, and ran the three flows in e2e/workspaces/tvos_demo_app against e2e/tvos_demo_app with each, using the Maestro 2.8.0.5 CLI.

Notes on the setup:

  • Built with Xcode 27, tvos_demo_app stops at launch on tvOS 27, which requires the UIScene lifecycle. For these runs it got a SceneDelegate that adopts the window React Native creates, and a UIApplicationSceneManifest in its Info.plist; that change is not part of this PR.
  • launchApp is not implemented on a physical device yet, so the device runs launched the app with devicectl and skipped the flows' first launchApp: clearState: true.
  • On the simulator, tvos-focus-flow loses its first key press when it presses before the app has focus (it passes once it first asserts the focused button), and tvos-text-input-flow fails at "Typed: Maestro". Both happen with main too.

No e2e test is added: the tvOS e2e suite runs on simulators, which do not have this failure.

Issues fixed

None filed.

@RuudBurger
RuudBurger requested a review from DouweBos October 28, 2026 10:49
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.

3 participants