Skip to content

Add tvOS real-device runner build#2

Open
setoelkahfi wants to merge 5 commits into
feature/tvos-supportfrom
feature/tvos-real-device
Open

Add tvOS real-device runner build#2
setoelkahfi wants to merge 5 commits into
feature/tvos-supportfrom
feature/tvos-real-device

Conversation

@setoelkahfi

@setoelkahfi setoelkahfi commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Builds on top of mobile-next#53 (tvOS simulator support) to add real Apple TV device support, mirroring the existing iOS real-device flow.

What this adds

  • scripts/patch-tvos-runner.sh now takes an optional second argument, simulator (default) or device. For device builds it pulls the Swift Testing libraries from AppleTVOS.platform instead of AppleTVSimulator.platform. Existing simulator callers are unchanged.
  • A new make tvos-ipa-unsigned target builds the devicekit-tvos scheme for generic/platform=tvOS, patches in the Device Kit icon and display name, and packages an unsigned devicekit-tvos-runner.ipa. This matches the iOS make ipa-unsigned pattern: ship the runner unsigned, then re-sign with a provisioning profile at install time (handled in mobilecli).
  • README build-targets table updated.

Why unsigned + re-sign

tvOS runtimes don't ship the Swift Testing libraries in the dyld cache, so the runner embeds them to launch via a plain install/launch rather than only through xcodebuild test. The embedded libs are ad-hoc signed at build time; mobilecli's ResignIPA deep-signs frameworks, plugins, and the main bundle when it installs with a provisioning profile, so everything ends up properly signed on the device.

Verification

Built the IPA locally and inspected it: platform TVOS, CFBundleDisplayName=Device Kit, CFBundlePrimaryIcon=App Icon, Assets.car present, and the Swift Testing libs embedded from AppleTVOS.platform. I don't have Apple TV hardware to run a full install here.

Related PRs:

setoelkahfi and others added 5 commits July 15, 2026 15:02
The DeviceKit XCUITest runner now builds for tvOS, so the automation
stack can drive the tvOS Simulator.

- Add a `devicekit-tvos` scheme and tvOS target to the Xcode project,
  plus a `scripts/patch-tvos-runner.sh` helper and Makefile targets that
  build and patch the tvOS runner.
- On tvOS, register a `device.io.button` handler that maps button names
  to `XCUIRemote.Button` presses (up, down, left, right, select, menu,
  home, playPause). tvOS navigates by focus, not touch.
- Keep the touch, keyboard, and orientation handlers iOS-only in the
  JSON-RPC dispatcher, behind `#if os(iOS)`.
- Read the screen size from `UIScreen.main.bounds` on tvOS, since there
  is no SpringBoard to query.
- Guard the remaining iOS-only handlers and helpers with `#if os(iOS)`
  so the shared sources still compile for both platforms.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add a compiled brandassets catalog (imagestack/imagestacklayer) for the
tvOS UI test runner, wire up ASSETCATALOG_COMPILER_APPICON_NAME and
CFBundleDisplayName on the devicekit-tvosUITests target, and extend
patch-tvos-runner.sh to copy the compiled Assets.car and set
CFBundleIcons/CFBundleDisplayName on the Runner.app so the tvOS test
runner now shows the same Device Kit icon as the iOS one.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Mirror the iOS real-device flow for tvOS. patch-tvos-runner.sh now takes a
simulator|device argument so it can pull the Swift Testing support libraries
from AppleTVOS.platform for device builds; the new tvos-ipa-unsigned Makefile
target builds the devicekit-tvos runner for generic/platform=tvOS, patches in
the Device Kit display name and icon, and packages an unsigned
devicekit-tvos-runner.ipa for re-signing at install time.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add a tvOS-only device.io.focus JSON-RPC handler that selects an element
by accessibility identifier/label and drives Siri Remote focus with a
bounded (<=50-move) traversal, returning the focused element on success
or a focusNotFound (-32002) error carrying the last focused element.

- New IOFocusMethodHandler (#if os(tvOS)); registered in the dispatcher
- Re-reads the target frame each move to handle tvOS focus scrolling
- Early-exit on no-progress (dead end / oscillation)
- Guard SpringBoard-specific DumpUI normalisation behind #if os(iOS) so
  tvOS dumps the foreground app's own accessibility hierarchy
- Remove throwaway Viaplay exploration scaffolding + unused import

Implements: SPECS/quality/real-tvos-device-support/SPEC.md (Milestone 4)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Allow the tvOS XCTest server to bind CoreDevice IPv6 tunnel addresses while preserving IPv4 localhost behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@setoelkahfi
setoelkahfi force-pushed the feature/tvos-real-device branch from 63081f1 to 55e7ab5 Compare July 15, 2026 13:03
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.

1 participant