Skip to content

Real Apple TV (tvOS) automation: dedicated TvosRobot + focus-by-identity tool#3

Closed
setoelkahfi wants to merge 3 commits into
mainfrom
feature/tvos-real-device
Closed

Real Apple TV (tvOS) automation: dedicated TvosRobot + focus-by-identity tool#3
setoelkahfi wants to merge 3 commits into
mainfrom
feature/tvos-real-device

Conversation

@setoelkahfi

@setoelkahfi setoelkahfi commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a dedicated TvosRobot to mobile-mcp so real Apple TV devices are driven through mobilecli/DeviceKit with tvOS-appropriate behaviour, while leaving the existing IosRobot/WebDriverAgent path unchanged for iPhone/iPad.

This is part of a three-repo change (initial PRs target the setoelkahfi forks; upstream mobile-next PRs are deferred until the three-repo E2E is green).

What's in this PR (Milestone 5, 6)

  • TvosRobot (mobilecli/DeviceKit-backed): Siri Remote buttons (UP/DOWN/LEFT/RIGHT/SELECT/MENU/PLAY_PAUSE); app lifecycle, screenshot, view-tree, and screen-size delegated to mobilecli; explicit unsupported on tvOS ActionableErrors for tap/doubleTap/longPress/swipe/orientation/text; best-effort openUrl surfacing the underlying error.
  • Routing: real Apple TVs (platform === "tvos") route to TvosRobot; iPhones/iPads keep routing to IosRobot (WDA). Extracted + unit-tested robotForIosDevice helper pins the boundary.
  • New mobile_focus_by_identifier MCP tool + Mobilecli.focusByIdentifier shelling to mobilecli io focus for accessibility-identity focus.
  • IosManager.listDevices() now retains platform so the dispatcher can distinguish Apple TV.
  • M6: device-free unit tests for platform routing, Siri Remote button mapping, unsupported-op errors, and focus.

Validation

  • npm run build (tsc strict) passes; npm run lint has 0 source errors; new test/tvos.ts unit tests pass. (Pre-existing test/ios.ts / test/iphone-simulator.ts failures are environmental — a booted tvOS simulator, no functional iPhone+WDA — and are unchanged by this PR.)

Guardrails

  • IosRobot/WebDriverAgent behaviour is unchanged for iPhone (D2). Android/simulator routing unchanged. No hard-coded fork/user paths; public MCP response shapes are additive-only; explicit unsupported errors over silent no-ops.

Implements: SPECS/quality/real-tvos-device-support/SPEC.md

Related PRs (three-repo change)

setoelkahfi and others added 3 commits July 15, 2026 09:43
tvOS simulators now surface through the MCP server.

- Accept `tvos` in the platform unions and validation in the mobilecli
  wrapper.
- Drop the hard `ios` filter on simulator discovery so tvOS simulators
  are returned, and report each device's real platform to analytics.
- List the tvOS Siri Remote buttons (UP, DOWN, LEFT, RIGHT, SELECT,
  MENU, PLAY_PAUSE) in the press-button tool description.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Detect physical Apple TV units by product type and report platform tvos in
mobile_list_available_devices instead of hardcoding ios. Route real tvOS
devices through mobilecli (which installs and drives the tvOS runner) while
iPhones and iPads keep using the WebDriverAgent-based IosRobot. Add a unit
test for platform detection.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add a dedicated TvosRobot (mobilecli/DeviceKit-backed) for real Apple TV,
keeping IosRobot/WebDriverAgent unchanged for iPhone/iPad (D2). Route
real Apple TVs (platform tvos) to TvosRobot via getRobotFromDevice; iOS
real devices continue to IosRobot.

- TvosRobot: Siri Remote buttons (UP/DOWN/LEFT/RIGHT/SELECT/MENU/
  PLAY_PAUSE); app/screenshot/view-tree/screen-size delegated to
  mobilecli; explicit unsupported-on-tvOS ActionableErrors for
  tap/doubleTap/longPress/swipe/orientation/text; best-effort openUrl
- New mobile_focus_by_identifier MCP tool + Mobilecli.focusByIdentifier
  shelling to mobilecli io focus (accessibility-identity focus)
- IosManager.listDevices retains platform so routing can distinguish
  Apple TV; extracted and tested robotForIosDevice helper
- Device-free unit tests for routing, button mapping, unsupported ops,
  and focus

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

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
mobile-mcp Ready Ready Preview, Comment Jul 15, 2026 7:45am

@setoelkahfi

Copy link
Copy Markdown
Owner Author

Superseded by upstream PR mobile-next#386. Keeping the branch as the source branch for upstream review.

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