From 2e08b2f214b9445084ce1dfb5b332afc164499ac Mon Sep 17 00:00:00 2001 From: Angly Cat Date: Thu, 5 Apr 2018 13:55:13 +0600 Subject: [PATCH] Fix running on simulators regressions --- local-cli/runIOS/runIOS.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/local-cli/runIOS/runIOS.js b/local-cli/runIOS/runIOS.js index 8927be98d80226..1cbcc4108db727 100644 --- a/local-cli/runIOS/runIOS.js +++ b/local-cli/runIOS/runIOS.js @@ -115,15 +115,12 @@ function runOnSimulator(xcodeProject, args, scheme) { if (!selectedSimulator.booted) { const simulatorFullName = formattedDeviceName(selectedSimulator); - console.log(`Booting ${simulatorFullName}...`); + console.log(`Launching ${simulatorFullName}...`); try { - child_process.execFileSync('xcrun', ['simctl', 'boot', selectedSimulator.udid]); + child_process.spawnSync('xcrun', ['instruments', '-w', selectedSimulator.udid]); } catch (e) { - throw new Error( -`Could not boot ${args.simulator} simulator. Is there already a simulator running? -Running multiple simulators is only supported from Xcode 9 and up. -Try closing the simulator or run the command again without specifying a simulator.` - ); + // instruments always fail with 255 because it expects more arguments, + // but we want it to only launch the simulator } }