Start simulator app if not already started

Summary:
Before this change, launching a simulator would ony show the simulator if the simulator process itself was already running. This makes sure that opening a simulator also works from a closed state

Changelog: Automatically start an iOS simulator to launch a device when none is running yet

Reviewed By: nikoant

Differential Revision: D24919363

fbshipit-source-id: 45039330710cf81aa73222967d667964bb01f42a
This commit is contained in:
Michel Weststrate
2020-11-12 16:31:13 -08:00
committed by Facebook GitHub Bot
parent c9a278fb0f
commit dcdec2608e
2 changed files with 4 additions and 3 deletions

View File

@@ -188,12 +188,13 @@ export function getSimulators(
});
}
export function launchSimulator(udid: string): Promise<any> {
return promisify(execFile)(
export async function launchSimulator(udid: string): Promise<any> {
await promisify(execFile)(
'xcrun',
['simctl', ...getDeviceSetPath(), 'boot', udid],
{encoding: 'utf8'},
);
await promisify(execFile)('open', ['-a', 'simulator']);
}
function getActiveDevices(idbPath: string): Promise<Array<IOSDeviceParams>> {