From 360dd4048b0061b8b4c015b893f187a945b68d3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Wed, 23 Sep 2026 17:28:11 +0200 Subject: [PATCH] fix(apple): classify visionOS simulators from their simctl runtime simctl deviceTypeIdentifiers are hyphenated (Apple-Vision-Pro-4K), so the two-word vision phrases never matched them, and the runtime key was dropped before classification. A visionOS simulator whose name lacked 'vision' was reported as appleOs ios. Pass the runtime key, which names xrOS, as a descriptor. --- .../src/simulator-inventory.test.ts | 21 +++++++++++++++++++ .../platform-apple/src/simulator-inventory.ts | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/packages/platform-apple/src/simulator-inventory.test.ts b/packages/platform-apple/src/simulator-inventory.test.ts index 501e42d74c..bf2c66c02d 100644 --- a/packages/platform-apple/src/simulator-inventory.test.ts +++ b/packages/platform-apple/src/simulator-inventory.test.ts @@ -68,6 +68,27 @@ test('simctl parser keeps available supported runtimes and their target semantic ]); }); +test('simctl parser classifies visionOS from the runtime when the name is not descriptive', () => { + const [device] = parseSimctlAppleDevices( + { + devices: { + 'com.apple.CoreSimulator.SimRuntime.xrOS-26-2': [ + { + name: 'test-1', + udid: 'vision-1', + state: 'Shutdown', + isAvailable: true, + deviceTypeIdentifier: 'com.apple.CoreSimulator.SimDeviceType.Apple-Vision-Pro-4K', + }, + ], + }, + }, + undefined, + ); + assert.equal(device?.target, 'mobile'); + assert.equal(device?.appleOs, 'visionos'); +}); + test('simulator inventory scopes bounded simctl and reports fresh booted observations', async () => { const calls: Array<{ tool: string; args: readonly string[]; timeoutMs?: number }> = []; const observed: string[] = []; diff --git a/packages/platform-apple/src/simulator-inventory.ts b/packages/platform-apple/src/simulator-inventory.ts index 3878add11e..c9369572eb 100644 --- a/packages/platform-apple/src/simulator-inventory.ts +++ b/packages/platform-apple/src/simulator-inventory.ts @@ -46,7 +46,7 @@ export function parseSimctlAppleDevices( name: device.name, kind: 'simulator', target, - appleOs: resolveAppleOs(target, [device.deviceTypeIdentifier ?? '', device.name]), + appleOs: resolveAppleOs(target, [runtime, device.deviceTypeIdentifier ?? '', device.name]), booted: device.state === 'Booted', ...(simulatorSetPath ? { simulatorSetPath } : {}), });