Skip to content
Browse files

Fix run-ios when specifying a scheme as cli arg

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/
Print: Entry, ":CFBundleIdentifier", Does Not Exist

This PR fixes this.

Tested manually from CLI.
Closes #13548

Differential Revision: D4914531

Pulled By: javache

fbshipit-source-id: 071710947e90e6194e0229751e33068565e010b2
  • Loading branch information...
pesterhazy authored and facebook-github-bot committed Apr 19, 2017
1 parent f519f16 commit c58e19ef3397db89ba0a8705d3fcafa17cf4aad7
Showing with 3 additions and 3 deletions.
  1. +3 −3 local-cli/runIOS/runIOS.js
@@ -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}`);

0 comments on commit c58e19e

Please sign in to comment.
You can’t perform that action at this time.