Add tvOS real-device runner build#2
Open
setoelkahfi wants to merge 5 commits into
Open
Conversation
This was referenced Jul 2, 2026
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
force-pushed
the
feature/tvos-real-device
branch
from
July 15, 2026 13:03
63081f1 to
55e7ab5
Compare
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.
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.shnow takes an optional second argument,simulator(default) ordevice. For device builds it pulls the Swift Testing libraries fromAppleTVOS.platforminstead ofAppleTVSimulator.platform. Existing simulator callers are unchanged.make tvos-ipa-unsignedtarget builds thedevicekit-tvosscheme forgeneric/platform=tvOS, patches in the Device Kit icon and display name, and packages an unsigneddevicekit-tvos-runner.ipa. This matches the iOSmake ipa-unsignedpattern: ship the runner unsigned, then re-sign with a provisioning profile at install time (handled in mobilecli).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/launchrather than only throughxcodebuild test. The embedded libs are ad-hoc signed at build time; mobilecli'sResignIPAdeep-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.carpresent, and the Swift Testing libs embedded fromAppleTVOS.platform. I don't have Apple TV hardware to run a full install here.Related PRs: