From 590aaa1627a38645adbb3c53dffa88ee565309bd Mon Sep 17 00:00:00 2001 From: luisbytes <137983537+luisbytes@users.noreply.github.com> Date: Tue, 22 Sep 2026 00:40:58 +0000 Subject: [PATCH 1/2] feat: support device hub for Xcode 27+ --- src/ios/utils/simulator.ts | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/ios/utils/simulator.ts b/src/ios/utils/simulator.ts index ebe8a4c..cc15c74 100644 --- a/src/ios/utils/simulator.ts +++ b/src/ios/utils/simulator.ts @@ -1,3 +1,4 @@ +import { pathExists } from '@ionic/utils-fs'; import { spawnSync } from 'child_process'; // TODO: need cross-spawn for windows? import * as Debug from 'debug'; @@ -85,11 +86,22 @@ export async function runOnSimulator(udid: string, appPath: string, bundleId: st const xCodePath = await getXCodePath(); debug(`Running simulator ${udid}`); - const openResult = spawnSync( - 'open', - [`${xCodePath}/Applications/Simulator.app`, '--args', '-CurrentDeviceUDID', udid], - { encoding: 'utf8' }, - ); + + const simulatorApp = `${xCodePath}/Applications/Simulator.app`; + const deviceHubApp = `${xCodePath}/../Applications/DeviceHub.app`; + + let openArgs: string[]; + + if (await pathExists(simulatorApp)) { + openArgs = [simulatorApp, '--args', '-CurrentDeviceUDID', udid]; + } else if (await pathExists(deviceHubApp)) { + openArgs = [`devices://device/open?id=${udid}`]; + } else { + throw new Exception(`Unable to find Simulator.app or DeviceHub.app in ${xCodePath}`); + } + + const openResult = spawnSync('open', openArgs, { encoding: 'utf8' }); + if (openResult.status) { throw new Exception(`There was an error opening simulator: ${openResult.stderr}`); } From 5de4fa473e29c05b67896f19538447983d2a3a1b Mon Sep 17 00:00:00 2001 From: Joseph Pender Date: Tue, 6 Oct 2026 09:57:11 -0500 Subject: [PATCH 2/2] fmt --- src/errors.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/errors.ts b/src/errors.ts index bae1fc4..cb122ec 100644 --- a/src/errors.ts +++ b/src/errors.ts @@ -78,10 +78,7 @@ export type AVDExceptionCode = typeof ERR_UNSUITABLE_API_INSTALLATION; export class AVDException extends AndroidException {} export type EmulatorExceptionCode = - | typeof ERR_ALREADY_RUNNING - | typeof ERR_AVD_HOME_NOT_FOUND - | typeof ERR_NON_ZERO_EXIT - | typeof ERR_UNKNOWN_AVD; + typeof ERR_ALREADY_RUNNING | typeof ERR_AVD_HOME_NOT_FOUND | typeof ERR_NON_ZERO_EXIT | typeof ERR_UNKNOWN_AVD; export class EmulatorException extends AndroidException {} @@ -98,10 +95,7 @@ export type SDKExceptionCode = export class SDKException extends AndroidException {} export type IOSRunExceptionCode = - | typeof ERR_TARGET_NOT_FOUND - | typeof ERR_NO_DEVICE - | typeof ERR_NO_TARGET - | typeof ERR_DEVICE_LOCKED; + typeof ERR_TARGET_NOT_FOUND | typeof ERR_NO_DEVICE | typeof ERR_NO_TARGET | typeof ERR_DEVICE_LOCKED; export class IOSRunException extends Exception {}