Skip to content

Commit c58e19e

Browse files
pesterhazyfacebook-github-bot
authored andcommitted
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 #13548 Differential Revision: D4914531 Pulled By: javache fbshipit-source-id: 071710947e90e6194e0229751e33068565e010b2
1 parent f519f16 commit c58e19e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

local-cli/runIOS/runIOS.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function runIOS(argv, config, args) {
4747
} else if (args.udid) {
4848
return runOnDeviceByUdid(args, scheme, xcodeProject, devices);
4949
} else {
50-
return runOnSimulator(xcodeProject, args, inferredSchemeName, scheme);
50+
return runOnSimulator(xcodeProject, args, scheme);
5151
}
5252
}
5353

@@ -66,7 +66,7 @@ function runOnDeviceByUdid(args, scheme, xcodeProject, devices) {
6666
}
6767
}
6868

69-
function runOnSimulator(xcodeProject, args, inferredSchemeName, scheme){
69+
function runOnSimulator(xcodeProject, args, scheme){
7070
return new Promise((resolve) => {
7171
try {
7272
var simulators = JSON.parse(
@@ -94,7 +94,7 @@ function runOnSimulator(xcodeProject, args, inferredSchemeName, scheme){
9494
.then((udid) => buildProject(xcodeProject, udid, scheme, args.configuration, args.packager))
9595
.then((appName) => {
9696
if (!appName) {
97-
appName = inferredSchemeName;
97+
appName = scheme;
9898
}
9999
let appPath = getBuildPath(args.configuration, appName);
100100
console.log(`Installing ${appPath}`);

0 commit comments

Comments
 (0)