Skip to content

fix: enable tvOS compilation for XCUITest runner#492

Merged
thymikee merged 4 commits into
callstackincubator:mainfrom
si-huynh:fix/tvos-xcuicoordinate-compile
May 12, 2026
Merged

fix: enable tvOS compilation for XCUITest runner#492
thymikee merged 4 commits into
callstackincubator:mainfrom
si-huynh:fix/tvos-xcuicoordinate-compile

Conversation

@si-huynh
Copy link
Copy Markdown
Contributor

@si-huynh si-huynh commented May 10, 2026

Summary

Harden tvOS runner support beyond compile-only guards by centralizing Siri Remote behavior in a shared Swift helper and wiring an explicit remotePress runner command through the TypeScript contract.

Expose tvOS focus in snapshots, route tvOS scroll/back/home through remote buttons, and reject touch-only gestures like pinch before dispatch. Scope expanded from the original Swift compile fix to Apple-family runtime behavior across 21 files.

Validation

  • pnpm format
  • pnpm exec vitest run src/platforms/ios/__tests__/runner-client.test.ts src/utils/__tests__/snapshot-lines-focused.test.ts src/utils/__tests__/interactors.test.ts src/core/__tests__/dispatch-pinch.test.ts
  • pnpm check:quick
  • pnpm check:fallow
  • pnpm build
  • pnpm build:xcuitest
  • pnpm build:xcuitest:tvos
  • Runtime tvOS Settings check: open, snapshot focus marker, remote scroll, select row, back, unsupported pinch, close

XCUICoordinate type and XCUIElement.tap() are unavailable on tvOS.
Gate coordinate-based interactions and touch APIs behind #if !os(tvOS)
and provide tvOS alternatives using XCUIRemote (Siri Remote) actions:

- tap/doubleTap → XCUIRemote.shared.press(.select)
- longPress → XCUIRemote.shared.press(.select, forDuration:)
- drag → directional remote press based on primary axis
- back gesture → XCUIRemote menu button
- app switcher → double home press
- pinch/rotate → return unsupported (no-op / false)
- keyboard dismiss → remote menu button
- alert accept/dismiss → remote select button

Verified: builds successfully for both tvOS Simulator and iOS Simulator.
@thymikee
Copy link
Copy Markdown
Member

Thanks! this is a good start, I'll pick it up from here and make sure the tvOS works as advertised.

Copy link
Copy Markdown
Member

Updated this to make tvOS support runtime-safe, not just compilable. Siri Remote behavior is now centralized in a Swift helper, remotePress is part of the runner contract, snapshots expose the focused tvOS row, and touch-only gestures are rejected before dispatch. This keeps platform branching contained while preserving iOS/macOS builds.

@thymikee thymikee merged commit d2a3742 into callstackincubator:main May 12, 2026
11 of 12 checks 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.

2 participants