Compare commits

...
Author SHA1 Message Date
Douglas Lowder a7f002fb47 Show both tvOS and iOS simulators in build:run 2023-09-26 19:00:01 -07:00
+4 -4
View File
@@ -10,7 +10,7 @@ interface IosSimulator {
runtime: string; runtime: string;
osVersion: string; osVersion: string;
windowName: string; windowName: string;
osType: 'iOS'; osType: 'iOS' | 'tvOS';
state: 'Booted' | 'Shutdown'; state: 'Booted' | 'Shutdown';
isAvailable: boolean; isAvailable: boolean;
name: string; name: string;
@@ -33,7 +33,7 @@ export async function selectSimulatorAsync(): Promise<IosSimulator> {
message: `Select a simulator to run your app on`, message: `Select a simulator to run your app on`,
name: 'selectedSimulator', name: 'selectedSimulator',
choices: simulators.map(simulator => ({ choices: simulators.map(simulator => ({
title: `iOS ${simulator.osVersion} ${simulator.name}`, title: `${simulator.osType} ${simulator.osVersion} ${simulator.name}`,
value: simulator, value: simulator,
})), })),
}); });
@@ -69,7 +69,7 @@ export async function getAvaliableIosSimulatorsListAsync(query?: string): Promis
// Create an array [tvOS, 13, 4] // Create an array [tvOS, 13, 4]
const [osType, ...osVersionComponents] = runtimeSuffix.split('-'); const [osType, ...osVersionComponents] = runtimeSuffix.split('-');
if (osType === 'iOS') { if (osType === 'iOS' || osType === 'tvOS') {
// Join the end components [13, 4] -> '13.4' // Join the end components [13, 4] -> '13.4'
const osVersion = osVersionComponents.join('.'); const osVersion = osVersionComponents.join('.');
const sims = info.devices[runtime]; const sims = info.devices[runtime];
@@ -80,7 +80,7 @@ export async function getAvaliableIosSimulatorsListAsync(query?: string): Promis
runtime, runtime,
osVersion, osVersion,
windowName: `${device.name} (${osVersion})`, windowName: `${device.name} (${osVersion})`,
osType: 'iOS' as const, osType,
state: device.state as 'Booted' | 'Shutdown', state: device.state as 'Booted' | 'Shutdown',
lastBootedAt: device.lastBootedAt ? new Date(device.lastBootedAt) : undefined, lastBootedAt: device.lastBootedAt ? new Date(device.lastBootedAt) : undefined,
}); });