Xcode 9 supports running multiple simulators

Summary:
Since Xcode 9 you can run multiple simultaneously. And since I believe React Native advocates using the latest version of Xcode, we can safely remove this constraint.

Updated the unit tests. Furthermore it can be found in the [Xcode release notes](https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/WhatsNewXcode/xcode_9/xcode_9.html#//apple_ref/doc/uid/TP40004626-CH8-SW12) that multiple simulators are now supported.

This can be tested with the CLI by running `react-native run-ios` twice, but with a different `--simulator` flag, e.g.;

    react-native run-ios --simulator "iPhone SE"
    react-native run-ios --simulator "iPhone X"

[IOS] [ENHANCEMENT] [local-cli/runIOS/findMatchingSimulator.js] - Allow running multiple simulators
Closes https://github.com/facebook/react-native/pull/17284

Differential Revision: D7102790

Pulled By: hramos

fbshipit-source-id: 750e7039201e28a1feda2bec1e78144fd9deff98
This commit is contained in:
Koen Punt
2018-02-27 14:03:50 -08:00
committed by Facebook Github Bot
parent 2dc559d1fb
commit 2ad34075f1
3 changed files with 38 additions and 24 deletions

View File

@@ -34,14 +34,12 @@ function findMatchingSimulator(simulators, simulatorName) {
if (simulator.availability !== '(available)') {
continue;
}
// If there is a booted simulator, we'll use that as instruments will not boot a second simulator
if (simulator.state === 'Booted') {
if (simulatorName !== null) {
console.warn("We couldn't boot your defined simulator due to an already booted simulator. We are limited to one simulator launched at a time.");
}
let booted = simulator.state === 'Booted';
if (booted && simulatorName === null) {
return {
udid: simulator.udid,
name: simulator.name,
booted,
version
};
}
@@ -49,6 +47,7 @@ function findMatchingSimulator(simulators, simulatorName) {
match = {
udid: simulator.udid,
name: simulator.name,
booted,
version
};
}
@@ -57,6 +56,7 @@ function findMatchingSimulator(simulators, simulatorName) {
match = {
udid: simulator.udid,
name: simulator.name,
booted,
version
};
}