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> { export async function launchSimulator(udid: string): Promise<any> {
return promisify(execFile)( await promisify(execFile)(
'xcrun', 'xcrun',
['simctl', ...getDeviceSetPath(), 'boot', udid], ['simctl', ...getDeviceSetPath(), 'boot', udid],
{encoding: 'utf8'}, {encoding: 'utf8'},
); );
await promisify(execFile)('open', ['-a', 'simulator']);
} }
function getActiveDevices(idbPath: string): Promise<Array<IOSDeviceParams>> { function getActiveDevices(idbPath: string): Promise<Array<IOSDeviceParams>> {

View File

@@ -164,7 +164,7 @@ export const PluginList = memo(function PluginList({
<PluginGroup <PluginGroup
key="disabled" key="disabled"
title="Disabled" title="Disabled"
hint="This section shows the plugins that are currently disabled. If a pluign is enabled, you will be able to interact with it. If a plugin is disabled it won't consume resources in Flipper or in the connected application."> hint="This section shows the plugins that are currently disabled. If a plugin is enabled, you will be able to interact with it. If a plugin is disabled it won't consume resources in Flipper or in the connected application.">
{disabledPlugins.map((plugin) => ( {disabledPlugins.map((plugin) => (
<PluginEntry <PluginEntry
key={plugin.id} key={plugin.id}