Skip to content

feat(testing-studio): add tvos support - #161

Merged
hurali97 merged 9 commits into
mainfrom
testing-studio/tvos
Dec 1, 2026
Merged

hurali97 merged 9 commits into
mainfrom
testing-studio/tvos

Conversation

@hurali97

@hurali97 hurali97 commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Description

This adds tvos support to Testing Studio.

  • Adds tvOS support to Testing Studio, including Apple TV discovery and live screen mirroring.
  • Routes Apple TV input through remote controls instead of touch.
  • Falls back to bounded screenshots when the display service rejects live video.
  • Keeps UHD frames and remote controls working across the native, server, and panel paths.

hurali97 and others added 8 commits November 30, 2026 16:04
Mark Apple TV simulators, projects and e2e targets as tvOS (appleOs)
while keeping the ios engine platform. Hide tap-based recording on
tvOS, pick targets by device OS, recognise PineBoard as the tvOS
launcher, and reject an installed build whose DTPlatformName does not
match the simulator.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Make tvOS simulators recordable in Testing Studio with remote-based steps.

- Add `press` (button, optional long-press duration), `pressUntilFocused` and
  `assertFocused` steps. Generated tests emit one `press` helper around the
  unstable `tvRemote` call, so an API change touches one place.
- Filter offers by Apple OS: tvOS hides tap, double tap, long press, swipe,
  scroll and coordinate taps; iOS and Android do not see the tvOS steps.
  `fill` is offered on tvOS after a spike showed the runner types into a
  focused tvOS text field.
- Mirror remote presses (keyboard and on-screen buttons) become `press`
  steps while recording. The recorder's agent-device session owns the
  simulator: the mirror's remote session is closed before the first tree
  read and presses go through the new `mobile_testing_press` tool.
- Read the `focused` state into the element tree.
- Agent recording on tvOS gets a press tool, no tap or swipe, a focus
  context line, and the focused item returned after each press.
- Retire the tvOS recording notice.

Existing recorder timings and event names are unchanged; new telemetry
attributes are left to the telemetry phase.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Run configs: a tvOS bundled run pins the Apple TV UDID on the iOS engine; the tv_remote agent
tool is added only when a tvOS run has agent steps. Project lanes pick their config target by
OS, so an iPhone lane and an Apple TV lane never share one.

Matrix: lanes, pins (TestTarget.appleOs, apps.tvos) and app ids are keyed by device kind. A
test never runs on a device of the other Apple OS; the checklist lists those devices as
unavailable with a reason and the server refuses them before anything boots.

Prepare: an Apple TV lane is never fed an iPhone build; it installs a Debug-appletvsimulator
build instead, and a tvOS 27 app without UIApplicationSceneManifest is explained before launch.

Session hand-off: runs release the mirror's tv-remote session as well as the recorder's, and
wait for both; the recorder's release is tracked so the mirror cannot reopen mid-release.
A blocking agent-device session or newer daemon is named instead of failing opaquely.

Progress: pressUntilFocused loops and press lines are planned as runner steps, so live
progress, the lane step count and the final report agree.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Discover tvOS devices through devicectl and carry their OS so the recorder
offers remote steps. An Apple TV pairs over the network only and sleeps, so
a paired but disconnected one is "asleep" with wake guidance, and an
unpaired one points at Remotes and Devices, never USB.

Install picks the Debug-appletvos build and checks DTPlatformName, skips
the Developer Mode check, and uses longer network timeouts for install,
launch and settle. A Metro connection failure on a physical Apple TV
explains the LAN IP and Release bundle options. The UI labels these devices
and marks them unverified: no hardware was available to test against.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Live-mirror a physical Apple TV in the device panel through the existing physical-iOS
HEVC route. Built without hardware; every assumption is listed in the ios-mirror README.

Native: tvOS devices tunnel over RemotePairing (never usbmuxd), skip touchscreen HID,
queue up to 16 MiB for 4K, declare 10-bit depth in the hvcC description and retry a
rejected offer once with a reduced bandwidth ladder. A display rejection is tagged so the
host can degrade.

Input and states: panel input is agent-device remote presses (keys, on-screen buttons,
long press via durationMs); touch is refused. A sleeping Apple TV shows a wake hint and
the stream reconnects when it wakes. A rejected display service falls back to bounded
screenshot polling with a notice. Telemetry gains the OS family and a bounded stream class.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Physical Apple TV support is unverified: there is no hardware and nothing creates the
RemotePairing record the mirror needs. Hide it unless MOBILE_DEV_PHYSICAL_APPLE_TV=1 is
set, and keep all the code.

Discovery queries only iOS hardware and drops tvOS entries without the flag, so no
physical Apple TV reaches the device panel, Connected devices, the matrix or the MCP
tools. Opening an Apple TV mirror and preparing a physical tvOS test lane fail with
"Physical Apple TV support is disabled". tvOS simulators are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Telemetry: Testing Studio timings for recording, single runs and matrix runs carry a
low-cardinality os attribute (ios or tvos). Remote presses and pressUntilFocused outcomes
(found, exhausted) are bounded aggregates, and mobile_testing_press is a frequent tool with
its own press count and duration metric instead of a span per press.

Fix: kept recordings (drafts) rejected the Apple TV steps, so a tvOS recording could not be
saved. The draft schema now accepts press, pressUntilFocused, assertFocused and maxPresses.

Tests: pinned bundled-runtime refusals for iPhone and Apple TV lanes, draft schema round
trips, and telemetry checks on the server and the panel. Adds an Apple TV host visual test
with step and offer snapshots, and a tvOS section in docs/testing-panel.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The No project target dropped its tvOS marker: the panel sent no Apple OS to
mobile_testing_project_config, so the server returned an unmarked iOS target and the
run omitted appleOs and deviceId, letting the runner take any booted iOS device.

- accept foregroundAppleOs on the tool and forward it into inspectProject
- send it from selectProject and the foreground refresh on an Apple TV simulator
- pin an unsaved run to the mirrored Apple TV simulator when the target lost its marker

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
mobile-dev Ignored Ignored Preview Dec 1, 2026 11:43am UTC

Request Review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Approval is blocked by four critical active issues: oversized keyframes remain rejected by the hub, endpoint discovery can select the wrong Apple TV, tunnel creation may reuse the wrong pairing connection, and screenshot fallback disables remote controls.

4 open issues
What changed in this PR

Adds tvOS support to Testing Studio while preserving the existing iOS execution path, including Apple TV simulator workflows, remote-based interactions, physical Apple TV mirroring, and related telemetry and documentation.

Changes:

  • Adds tvOS-aware device classification, target discovery, project and matrix handling, build selection, recording, and test execution.
  • Adds Apple TV remote controls, focus assertions, remote step persistence, and UI support.
  • Extends native mirroring with RemotePairing, Bonjour discovery, 4K/10-bit HEVC support, reduced-bandwidth negotiation, and screenshot fallback.
  • Adds extensive shared, UI, core, native, visual, integration, and telemetry tests.
  • Review findings identify critical issues with the Node frame-size limit, Bonjour candidate selection, RemotePairing connection reuse, and remote readiness during screenshot fallback.
File Description
tooling/​hosts/​visual.spec.ts Adds visual coverage for Apple TV Testing Studio workflows.
packages/​ui/​test/​ui-telemetry.test.ts Tests tvOS-scoped UI telemetry aggregation.
packages/​ui/​test/​testing-view-tvos.test.ts Tests tvOS recording controls and notices.
packages/​ui/​test/​testing-panel.test.ts Tests Apple TV run arguments and metadata.
packages/​ui/​test/​testing-matrix.test.ts Tests tvOS matrix classification and progress behavior.
packages/​ui/​test/​test-recorder.test.ts Tests remote and focus-based recording behavior.
packages/​ui/​test/​simulator-panel.test.ts Tests Apple TV mirroring, remote input, and screenshot fallback.
packages/​ui/​test/​physical-appletv.test.ts Tests physical Apple TV inventory and matrix data.
packages/​ui/​test/​apple-tv-mirror.test.ts Tests Apple TV remote mapping and screenshot polling.
packages/​ui/​src/​testing-matrix.ts Adds tvOS-aware matrix device and app compatibility logic.
packages/​ui/​src/​telemetry.ts Adds OS-scoped Testing Studio timing and event aggregates.
packages/​ui/​src/​ios-mirror-video.ts Configures video decoding for 10-bit HEVC streams.
packages/​ui/​src/​device-inventory.ts Displays and retains physical Apple TV states.
packages/​ui/​src/​components/​testing-view.tsx Adds tvOS recording blockers, notices, and command filtering.
packages/​ui/​src/​components/​testing-matrix.tsx Adds Apple TV matrix grouping and availability badges.
packages/​ui/​src/​components/​test-recorder-overlay.tsx Explains unavailable tvOS element actions.
packages/​ui/​src/​components/​step-commands.tsx Adds remote and focus command presentation.
packages/​ui/​src/​apple-tv-mirror.ts Implements Apple TV remote and screenshot fallback helpers.
packages/​shared/​test/​test-recording.test.ts Tests tvOS step offers and emitted remote helpers.
packages/​shared/​test/​test-drafts.test.ts Tests persistence of remote steps in test drafts.
packages/​shared/​test/​stored-test-steps.test.ts Tests call planning and focus-loop progress mapping.
packages/​shared/​test/​apple-os.test.ts Tests Apple OS classification and target selection.
packages/​shared/​src/​test-drafts.ts Extends draft schemas for tvOS steps.
packages/​shared/​src/​telemetry.ts Marks remote input as a frequent telemetry tool.
packages/​shared/​src/​stored-test-steps.ts Adds stored-test call planning and focus-loop reconciliation.
packages/​shared/​src/​screen-annotations.ts Adds focused-state screen annotations.
packages/​shared/​src/​panel-target.ts Classifies tvOS devices and recordability.
packages/​shared/​src/​ios-video.ts Adds stream depth and class metadata.
packages/​shared/​src/​ios-mirror-errors.ts Adds Apple TV input and display-rejection errors.
packages/​shared/​src/​ios-devices.ts Adds Apple TV availability, pairing, and status helpers.
packages/​shared/​src/​apple-os.ts Defines Apple OS classification and app-key utilities.
packages/​native/​vendor/​ios-mirror/​release.json Updates native mirror artifact hashes.
packages/​native/​ios-mirror/​src/​tvos.rs Adds RemotePairing and Bonjour-based Apple TV tunnel support.
packages/​native/​ios-mirror/​src/​queue.rs Raises the native frame queue limit for Apple TV streams.
packages/​native/​ios-mirror/​src/​platform.rs Defines tvOS tunnel, input, and negotiation policy.
packages/​native/​ios-mirror/​src/​media/​negotiation.rs Adds reduced-bandwidth video offer generation.
packages/​native/​ios-mirror/​src/​media/​hevc.rs Parses HEVC sample format and bit depth.
packages/​native/​ios-mirror/​src/​lib.rs Registers the new tvOS native modules.
packages/​native/​ios-mirror/​src/​input.rs Makes touchscreen input optional for tvOS.
packages/​native/​ios-mirror/​src/​codec.rs Emits depth-aware HEVC decoder configuration.
packages/​native/​ios-mirror/​README.md Documents Apple TV mirroring assumptions and limitations.
packages/​native/​ios-mirror/​Cargo.toml Enables RemotePairing, mDNS, and networking dependencies.
packages/​core/​test/​tvos-run.test.ts Tests tvOS bundled runs, agents, and simulator preparation.
packages/​core/​test/​tvos-pinned.test.ts Tests tvOS target pinning and matrix rejection.
packages/​core/​test/​testing-projects.test.ts Tests tvOS target and native-source discovery.
packages/​core/​test/​testing-prepare.test.ts Tests tvOS build compatibility checks.
packages/​core/​test/​testing-matrix-project.test.ts Tests mixed iOS and tvOS project lanes.
packages/​core/​test/​testing-foreground-target.test.ts Tests foreground Apple TV target discovery.
packages/​core/​test/​testing-agent.test.ts Tests agent focus and remote steps.
packages/​core/​test/​telemetry.test.ts Tests Apple TV and remote telemetry privacy.
packages/​core/​test/​ios-mirror.test.ts Tests tvOS mirror sessions and touch rejection.
packages/​core/​test/​ios-mirror-tools.test.ts Tests Apple TV mirror tool behavior.
packages/​core/​test/​ios-mirror-hub.test.ts Tests tvOS stream metadata and opt-in handling.
packages/​core/​test/​ios-devices.test.ts Tests opt-in physical Apple TV discovery.
packages/​core/​test/​ios-device-build.test.ts Tests OS-specific device build lookup.
packages/​core/​src/​tvos-scene.ts Detects the tvOS 27 scene-manifest requirement.
packages/​core/​src/​tvos-metro.ts Adds physical Apple TV Metro diagnostics.
packages/​core/​src/​testing-target-discovery.ts Preserves Apple OS metadata for foreground targets.
packages/​core/​src/​testing-run.ts Adds tvOS bundled-run configuration and agent remote tools.
packages/​core/​src/​testing-projects.ts Detects tvOS projects and stores per-OS app targets.
packages/​core/​src/​testing-matrix.ts Carries tvOS metadata through matrix lanes.
packages/​core/​src/​testing-device.ts Adds remote actions and Apple OS session context.
packages/​core/​src/​telemetry.ts Adds native stream and remote-input metrics.
packages/​core/​src/​stream-sessions.ts Rejects touch input for tvOS simulators.
packages/​core/​src/​physical-ios-settle.ts Extends physical Apple TV settle bounds.
packages/​core/​src/​physical-apple-tv.ts Adds opt-in gating for physical Apple TVs.
packages/​core/​src/​panel-tools.ts Avoids simulated HID repair on tvOS.
packages/​core/​src/​ios-native-capture.ts Extends native capture options with Apple OS metadata.
packages/​core/​src/​ios-mirror.ts Tracks tvOS sessions and rejects touch input.
packages/​core/​src/​ios-mirror-tools.ts Opens Apple TV sessions and reports availability.
packages/​core/​src/​ios-mirror-service.ts Reports Apple TV stream telemetry.
packages/​core/​src/​ios-mirror-server.ts Passes Apple OS metadata through RPC.
packages/​core/​src/​ios-mirror-rpc.ts Extends mirror-open request validation.
packages/​core/​src/​ios-mirror-hub.ts Tracks tvOS captures and blocks touch input.
packages/​core/​src/​ios-mirror-client.ts Sends Apple TV options to the native service.
packages/​core/​src/​ios-devices.ts Discovers and filters physical Apple TVs.
packages/​core/​src/​ios-device-build.ts Selects iOS, tvOS, and simulator build products.
packages/​core/​src/​device-session-errors.ts Explains agent-device session conflicts.
packages/​core/​src/​baguette.ts Uses shared tvOS runtime classification.
docs/​testing-panel.md Documents tvOS recording, targets, matrices, and limitations.
docs/​telemetry.md Documents tvOS and remote-input telemetry.

Review effort: Lite

Comment thread packages/native/ios-mirror/src/queue.rs Resolved
Comment thread packages/native/ios-mirror/src/tvos.rs Resolved
Comment thread packages/native/ios-mirror/src/tvos.rs Resolved
Comment thread packages/ui/src/simulator-panel.ts Resolved
@hurali97
hurali97 merged commit b8b7c3c into main Dec 1, 2026
16 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