Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/thirty-worlds-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rock-js/platform-apple-helpers': patch
---

Support launching Apple simulators through Device Hub in Xcode 27.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import fs from 'node:fs';
import path from 'node:path';
import type { SubprocessError } from '@rock-js/tools';
import { color, logger, RockError, spawn, spinner } from '@rock-js/tools';
Expand All @@ -24,12 +25,18 @@ export async function launchSimulator(device: Device) {
stdio: 'pipe',
});

await spawn('open', [
`${activeDeveloperDir}/Applications/Simulator.app`,
'--args',
'-CurrentDeviceUDID',
device.udid,
]);
const simulatorApp = path.join(activeDeveloperDir.trim(), 'Applications', 'Simulator.app');

if (fs.existsSync(simulatorApp)) {
await spawn('open', [
simulatorApp,
'--args',
'-CurrentDeviceUDID',
device.udid,
]);
} else {
await spawn('open', [`devices://device/open?id=${device.udid}`]);
}

if (device.state !== 'Booted') {
await bootSimulator(device);
Expand Down
Loading