Skip to content

Commit 360dd40

Browse files
committed
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.
1 parent 1f9f2bc commit 360dd40

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

‎packages/platform-apple/src/simulator-inventory.test.ts‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,27 @@ test('simctl parser keeps available supported runtimes and their target semantic
6868
]);
6969
});
7070

71+
test('simctl parser classifies visionOS from the runtime when the name is not descriptive', () => {
72+
const [device] = parseSimctlAppleDevices(
73+
{
74+
devices: {
75+
'com.apple.CoreSimulator.SimRuntime.xrOS-26-2': [
76+
{
77+
name: 'test-1',
78+
udid: 'vision-1',
79+
state: 'Shutdown',
80+
isAvailable: true,
81+
deviceTypeIdentifier: 'com.apple.CoreSimulator.SimDeviceType.Apple-Vision-Pro-4K',
82+
},
83+
],
84+
},
85+
},
86+
undefined,
87+
);
88+
assert.equal(device?.target, 'mobile');
89+
assert.equal(device?.appleOs, 'visionos');
90+
});
91+
7192
test('simulator inventory scopes bounded simctl and reports fresh booted observations', async () => {
7293
const calls: Array<{ tool: string; args: readonly string[]; timeoutMs?: number }> = [];
7394
const observed: string[] = [];

‎packages/platform-apple/src/simulator-inventory.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export function parseSimctlAppleDevices(
4646
name: device.name,
4747
kind: 'simulator',
4848
target,
49-
appleOs: resolveAppleOs(target, [device.deviceTypeIdentifier ?? '', device.name]),
49+
appleOs: resolveAppleOs(target, [runtime, device.deviceTypeIdentifier ?? '', device.name]),
5050
booted: device.state === 'Booted',
5151
...(simulatorSetPath ? { simulatorSetPath } : {}),
5252
});

0 commit comments

Comments
 (0)