Fix run-ios when specifying a scheme as cli arg

Summary:
The cli arg `--scheme` allows you to override the inferred scheme.
The runOnDevice command takes this override into account, but run-ios
doesn't. This commit fixes this discrepancy.

Thanks for submitting a PR! Please read these instructions carefully:

- [x] Explain the **motivation** for making this change.
- [x] Provide a **test plan** demonstrating that the code is solid.
- [x] Match the **code formatting** of the rest of the codebase.
- [x] Target the `master` branch, NOT a "stable" branch.

Currently if a custom scheme is specified, `run-ios` will fail with the following message

```
Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/AwesomeProject.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
```

This PR fixes this.

Tested manually from CLI.
Closes https://github.com/facebook/react-native/pull/13548

Differential Revision: D4914531

Pulled By: javache

fbshipit-source-id: 071710947e90e6194e0229751e33068565e010b2
This commit is contained in:
Paulus Esterhazy 2017-04-19 11:19:05 -07:00 committed by Facebook Github Bot
parent f519f16180
commit c58e19ef33
1 changed files with 3 additions and 3 deletions

View File

@ -47,7 +47,7 @@ function runIOS(argv, config, args) {
} else if (args.udid) {
return runOnDeviceByUdid(args, scheme, xcodeProject, devices);
} else {
return runOnSimulator(xcodeProject, args, inferredSchemeName, scheme);
return runOnSimulator(xcodeProject, args, scheme);
}
}
@ -66,7 +66,7 @@ function runOnDeviceByUdid(args, scheme, xcodeProject, devices) {
}
}
function runOnSimulator(xcodeProject, args, inferredSchemeName, scheme){
function runOnSimulator(xcodeProject, args, scheme){
return new Promise((resolve) => {
try {
var simulators = JSON.parse(
@ -94,7 +94,7 @@ function runOnSimulator(xcodeProject, args, inferredSchemeName, scheme){
.then((udid) => buildProject(xcodeProject, udid, scheme, args.configuration, args.packager))
.then((appName) => {
if (!appName) {
appName = inferredSchemeName;
appName = scheme;
}
let appPath = getBuildPath(args.configuration, appName);
console.log(`Installing ${appPath}`);