Skip to content

Add tvOS platform support#363

Open
setoelkahfi wants to merge 1 commit into
mobile-next:mainfrom
setoelkahfi:feature/tvos-support
Open

Add tvOS platform support#363
setoelkahfi wants to merge 1 commit into
mobile-next:mainfrom
setoelkahfi:feature/tvos-support

Conversation

@setoelkahfi

@setoelkahfi setoelkahfi commented Jun 30, 2026

Copy link
Copy Markdown

What

tvOS simulators now surface through the MCP server, so an MCP client can find and control them the same way it does iOS simulators.

Changes

  • Accepts tvos in the platform unions and validation in the mobilecli wrapper.
  • Drops the hard ios filter on simulator discovery, so tvOS simulators are returned. Analytics now reports each device's real platform instead of a hardcoded ios.
  • Lists the tvOS Siri Remote buttons (UP, DOWN, LEFT, RIGHT, SELECT, MENU, PLAY_PAUSE) in the press-button tool description.

Depends on

Testing

With a booted tvOS simulator, mobile_list_available_devices returns it and mobile_press_button moves its focus.

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>
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Walkthrough

The change adds "tvos" as a supported platform across the codebase. In src/mobilecli.ts, the MobilecliDevicesOptions.platform and MobilecliDevicesResponse device platform type unions are widened to include "tvos", and the getDevices runtime validation and error message are updated accordingly. In src/server.ts, MobilecliDevice.platform is similarly widened, simulator discovery queries now include tvOS alongside iOS, posthog telemetry for simulators uses device.platform instead of a hardcoded "ios" string, and the mobile_press_button tool's button list is expanded with tvOS-specific buttons.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding tvOS platform support.
Description check ✅ Passed The description is clearly related and matches the tvOS simulator support changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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.

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (1)
src/server.ts (1)

521-521: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Make button machine-validatable, not description-only.

button is still a free-form string, so clients cannot validate or autocomplete the new tvOS buttons from the schema, and typos will only fail deeper in the stack. If this is a closed set, prefer a shared z.enum(...) here.

Suggested direction
+const SUPPORTED_BUTTONS = [
+  "BACK",
+  "HOME",
+  "VOLUME_UP",
+  "VOLUME_DOWN",
+  "ENTER",
+  "DPAD_CENTER",
+  "DPAD_UP",
+  "DPAD_DOWN",
+  "DPAD_LEFT",
+  "DPAD_RIGHT",
+  "UP",
+  "DOWN",
+  "LEFT",
+  "RIGHT",
+  "SELECT",
+  "MENU",
+  "PLAY_PAUSE",
+] as const;
+
 tool(
   "mobile_press_button",
   "Press Button",
   "Press a button on device",
   {
     device: z.string().describe("The device identifier to use. Use mobile_list_available_devices to find which devices are available to you."),
-    button: z.string().describe("The button to press. Supported buttons: BACK (android only), HOME, VOLUME_UP, VOLUME_DOWN, ENTER, DPAD_CENTER (android tv only), DPAD_UP (android tv only), DPAD_DOWN (android tv only), DPAD_LEFT (android tv only), DPAD_RIGHT (android tv only), UP (tvOS only), DOWN (tvOS only), LEFT (tvOS only), RIGHT (tvOS only), SELECT (tvOS only), MENU (tvOS only), PLAY_PAUSE (tvOS only)"),
+    button: z.enum(SUPPORTED_BUTTONS).describe("The button to press. Some buttons are platform-specific."),
   },
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/server.ts` at line 521, The `button` field in the schema is still defined
as a free-form `z.string()` in `server.ts`, so it cannot be machine-validated or
autocompleted. Replace it with a shared `z.enum(...)` covering the supported
button values, and reuse that enum in the relevant schema so the `button`
constraint is enforced at validation time rather than only described in text.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/server.ts`:
- Line 521: The `button` field in the schema is still defined as a free-form
`z.string()` in `server.ts`, so it cannot be machine-validated or autocompleted.
Replace it with a shared `z.enum(...)` covering the supported button values, and
reuse that enum in the relevant schema so the `button` constraint is enforced at
validation time rather than only described in text.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 63cdf31c-400f-4757-a15b-598dce6c3cac

📥 Commits

Reviewing files that changed from the base of the PR and between 7782ed5 and e7891bd.

📒 Files selected for processing (2)
  • src/mobilecli.ts
  • src/server.ts

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