Skip to content

fix(simulator): prefer Device Hub for simulator UI#479

Merged
cameroncooke merged 4 commits into
mainfrom
cameroncooke/xcode-27
Jul 21, 2026
Merged

fix(simulator): prefer Device Hub for simulator UI#479
cameroncooke merged 4 commits into
mainfrom
cameroncooke/xcode-27

Conversation

@cameroncooke

Copy link
Copy Markdown
Collaborator

Summary

  • prefer Device Hub for visible simulator workflows, with Simulator.app as the compatibility fallback
  • target the requested simulator in Device Hub by UDID and route keyboard controls through its Device > Keyboard menu
  • keep headless behavior unchanged and align Claude UI benchmark lifecycle commands
  • update tool descriptions and the unreleased changelog

Validation

  • npm run lint:fix
  • npm run lint (107 existing warnings, 0 errors)
  • npm run typecheck
  • npm run format
  • npm run format:check
  • npm run build
  • npm test (2,893 tests passed)
  • pre-commit formatting, lint, and build hooks

Snapshot and smoke suites were not run locally because repository policy requires explicit approval.

Compatibility note

The Device Hub selection URL devices:///manage/select?id=<UDID> is private and undocumented. It was verified against Xcode 27 beta 4: Device Hub accepted the URL and requested interaction for the specified simulator. If Device Hub cannot open, XcodeBuildMCP falls back to Simulator.app.

Open Device Hub for visible simulator workflows when available, with Simulator.app as the compatibility fallback. Target the selected simulator by UDID and drive keyboard controls through Device Hub's menus.
@pkg-pr-new

pkg-pr-new Bot commented Jul 20, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/xcodebuildmcp@479

commit: 5490502

Comment thread src/mcp/tools/simulator-management/_keyboard_shortcut.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a4e7380. Configure here.

Comment thread .axe-version
Copilot AI review requested due to automatic review settings July 21, 2026 09:59

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.

Pull request overview

This PR updates simulator “visibility” workflows to prefer Xcode 27’s Device Hub as the primary simulator frontend (with Simulator.app as a fallback), and adjusts simulator keyboard-control automation to route through the selected frontend while keeping headless behavior unchanged.

Changes:

  • Added a new “simulator frontend” selection/opening abstraction (Device Hub first, Simulator.app fallback) and wired it into open_sim and build_run_sim.
  • Updated simulator-management keyboard shortcut automation to use Device Hub when available, with test updates across the simulator-management suite.
  • Updated Claude UI benchmark simulator lifecycle + preflight focus commands to open the preferred frontend and added supporting benchmark helper code.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/utils/focus-policy.ts Adds frontend candidate building + “open frontend” helper with Device Hub preference and headless skip.
src/utils/tests/focus-policy.test.ts Adds coverage for frontend command selection and open/fallback behavior.
src/server/server.ts Updates embedded guidance text to reflect “simulator frontend” terminology.
src/mcp/tools/simulator/open_sim.ts Switches tool implementation from opening Simulator.app to opening the preferred frontend.
src/mcp/tools/simulator/build_run_sim.ts Uses preferred frontend opening (best-effort) after booting the simulator.
src/mcp/tools/simulator/tests/open_sim.test.ts Updates expectations to Device Hub being attempted first.
src/mcp/tools/simulator-management/_keyboard_shortcut.ts Routes keyboard shortcuts through Device Hub when available; retains Simulator.app scripting as fallback.
src/mcp/tools/simulator-management/tests/toggle_software_keyboard.test.ts Updates assertions to validate Device Hub shortcut scripting.
src/mcp/tools/simulator-management/tests/toggle_connect_hardware_keyboard.test.ts Updates assertions to validate Device Hub shortcut scripting.
src/mcp/tools/simulator-management/tests/_keyboard_shortcut.test.ts Updates FIFO expectations for Device Hub attempt/fallback and revised scripting.
src/benchmarks/claude-ui/simulator-lifecycle.ts Replaces direct Simulator.app open logic with benchmark frontend opener.
src/benchmarks/claude-ui/simulator-frontend.ts New benchmark helper to open preferred frontend with retries + logging.
src/benchmarks/claude-ui/preflight-commands.ts Injects frontend focus commands using `open …
src/benchmarks/claude-ui/tests/simulator-lifecycle.test.ts Updates expected open commands/events to Device Hub selection URL.
src/benchmarks/claude-ui/tests/simulator-existing-lifecycle.test.ts Updates expected open commands and adds Device Hub unavailable fallback coverage.
src/benchmarks/claude-ui/tests/preflight-commands.test.ts Updates expected injected focus commands to include Device Hub URL + fallback.
manifests/tools/toggle_software_keyboard.yaml Updates tool description to remove Simulator.app-specific shortcut wording.
manifests/tools/toggle_connect_hardware_keyboard.yaml Updates tool description to remove Simulator.app-specific shortcut wording.
manifests/tools/open_sim.yaml Updates tool description to “simulator frontend” terminology.
manifests/tools/build_run_sim.yaml Updates tool description (but still attempts frontend opening in code).
CHANGELOG.md Adds unreleased fix entry describing Device Hub preference + fallback behavior.
.axe-version Bumps bundled AXe version.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread manifests/tools/build_run_sim.yaml
Comment thread src/mcp/tools/simulator-management/_keyboard_shortcut.ts
@cameroncooke
cameroncooke merged commit 7cd7d5a into main Jul 21, 2026
26 of 29 checks passed
@cameroncooke
cameroncooke deleted the cameroncooke/xcode-27 branch July 21, 2026 12:18
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