Skip to content

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

Draft
setoelkahfi wants to merge 3 commits into
mobile-next:mainfrom
setoelkahfi:feature/tvos-real-device
Draft

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

Conversation

@setoelkahfi

@setoelkahfi setoelkahfi commented Jul 15, 2026

Copy link
Copy Markdown

Summary

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

This is part of a three-repo upstream change across mobile-next/mobilecli, mobile-next/devicekit-ios, and mobile-next/mobile-mcp.

What's in this PR

  • New TvosRobot for real Apple TV routing.
  • Siri Remote button support: UP, DOWN, LEFT, RIGHT, SELECT, MENU, PLAY_PAUSE.
  • Explicit actionable unsupported errors for tvOS-inapplicable touch/orientation/text operations.
  • New mobile_focus_by_identifier MCP tool delegating to mobilecli io focus.
  • iPhone/iPad continue to use IosRobot/WDA; Android and simulator routing unchanged.
  • Unit tests for platform routing, button mapping, unsupported errors, and focus.

Validation

  • npm run build
  • npm run lint has 0 source errors
  • New test/tvos.ts unit tests pass

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

Related PRs

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b04fb3d4-1fd3-4fb9-8ad8-74e8f337d1cb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

setoelkahfi and others added 3 commits July 15, 2026 15:02
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>
@setoelkahfi
setoelkahfi force-pushed the feature/tvos-real-device branch from c29090a to 7e7c0f2 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