feat: support device hub for Xcode 27+

Merged
LU
19d ago
+19-13

Description

Resolves https://github.com/ionic-team/capacitor/issues/8620

Add Xcode 27 support by opening the requested simulator through Device Hub when Simulator.app is unavailable.

The implementation detects the available application instead of checking the Xcode version, preserving the existing behavior on older Xcode versions.

Change Type

  • Fix
  • Feature
  • Refactor
  • Breaking Change
  • Documentation
  • Other (CI, chores, etc.)

Rationale / Problems Fixed

Xcode 27 replaces Simulator.app with Device Hub, causing native-run to fail when opening the simulator.

This approach avoids Xcode version checks and preserves simulator targeting by using devices://device/open?id=<UDID> to open the requested simulator directly.

This is also aligned with the approach adopted by React Native CLI in [PR #2806](https://github.com/react-native-community/cli/pull/2806).

Tests or Reproductions

Tested with Xcode 27 and a Capacitor app using npx cap run ios.

Verified that the requested simulator is opened correctly through Device Hub.

Platforms Affected

  • Android
  • iOS
  • Web

Notes / Comments

PR #405 resolves Device Hub relative to the selected Xcode, but opening DeviceHub.app with -CurrentDeviceUDID does not select the requested simulator. In testing, Device Hub opens the last simulator used and launches in the expanded management view.

PR #406 adds Xcode-version-specific handling to open Device Hub. This PR instead detects whether Simulator.app or Device Hub is available, avoiding version checks.

When Device Hub is used, devices://device/open?id=<UDID> opens the requested simulator directly in the compact simulator view, providing behavior closer to the previous Simulator.app -CurrentDeviceUDID flow.