Skip to content

[Bug]: cap run ios cannot open iOS simulators on Xcode 27聽#8620

Closed
ionic-team/native-run
#408

Description

@luisbytes

Capacitor Version

馃拪 Capacitor Doctor 馃拪

Latest Dependencies:

@capacitor/cli: 8.5.2
@capacitor/core: 8.5.2
@capacitor/android: 8.5.2
@capacitor/ios: 8.5.2

Installed Dependencies:

@capacitor/cli: 8.5.1
@capacitor/core: 8.5.1
@capacitor/android: 8.5.1
@capacitor/ios: 8.5.1

[success] iOS looking great! 馃憣
[success] Android looking great! 馃憣

Other API Details

Xcode: 27
macOS: 27

Platforms Affected

  • iOS
  • Android
  • Web

Current Behavior

With Xcode 27, running:

npx cap run ios

fails when trying to open the selected iOS simulator.

Xcode 27 no longer includes Simulator.app and uses Device Hub instead, but cap run ios still attempts to open the removed application.

Expected Behavior

npx cap run ios should work with Xcode 27 and open the selected iOS simulator as expected.

Project Reproduction

N/A

Additional Information

@capacitor/cli uses native-run to run the app on the iOS simulator. The current simulator handling in native-run still expects Simulator.app to be available, which is no longer the case with Xcode 27.

This issue does not occur with previous Xcode versions where Simulator.app is still available.

Activity

  1. added theissue type on Sep 21, 2026
  2. luisbytes commented on Sep 22, 2026

    @luisbytes
    ContributorAuthor

    I opened a PR in native-run to add Xcode 27 support: ionic-team/native-run#408

    It detects whether Simulator.app or Device Hub is available and uses the simulator UDID to open the requested simulator, without relying on Xcode version checks.

  3. luisbytes commented on Sep 30, 2026

    @luisbytes
    ContributorAuthor

    I鈥檓 leaving this patch here as a temporary workaround for the issue with Xcode 27.

    diff --git a/dist/ios/utils/simulator.js b/dist/ios/utils/simulator.js
    index 5786f44ac212c322629400f23dc82663a182a746..8fe34d960df022c23381312b132a0d5d035a453b 100644
    --- a/dist/ios/utils/simulator.js
    +++ b/dist/ios/utils/simulator.js
    @@ -46,7 +46,7 @@ async function runOnSimulator(udid, appPath, bundleId, waitForApp) {
         }
         const xCodePath = await (0, xcode_1.getXCodePath)();
         debug(`Running simulator ${udid}`);
    -    const openResult = (0, child_process_1.spawnSync)('open', [`${xCodePath}/Applications/Simulator.app`, '--args', '-CurrentDeviceUDID', udid], { encoding: 'utf8' });
    +    const openResult = (0, child_process_1.spawnSync)('open', [`devices://device/open?id=${udid}`], { encoding: 'utf8' });
         if (openResult.status) {
             throw new errors_1.Exception(`There was an error opening simulator: ${openResult.stderr}`);
         }

    To use it with pnpm, save the diff as patches/native-run.patch, then add this to your pnpm-workspace.yaml:

    patchedDependencies:
      "native-run@2.0.3": patches/native-run.patch

    Then run pnpm install to apply the patch.

  4. luisbytes commented on Oct 2, 2026

    @luisbytes
    ContributorAuthor

    Hi @theproducer, could this be considered for the next release?

  5. self-assigned this
    on Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions