Skip to content

Commit

Permalink
Merge branch 'master' into TIMOB-27446
Browse files Browse the repository at this point in the history
  • Loading branch information
ssaddique committed Oct 10, 2019
2 parents 9c53bf5 + 65527be commit e0e6387
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 176 deletions.
22 changes: 21 additions & 1 deletion iphone/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -6784,9 +6784,29 @@ iOSBuilder.prototype.invokeXcodeBuild = function invokeXcodeBuild(next) {
];

if (this.simHandle) {
let dest;
const xcodeId = this.xcodeEnv.version + ':' + this.xcodeEnv.build;

// xcodebuild requires a -destination when building for iOS Simulator and it needs a
// simulator that is compatible with the selected Xcode version, so just pick one
for (const sims of Object.values(this.iosInfo.simulators.ios)) {
for (const sim of sims) {
if (sim.supportsXcode[xcodeId]) {
dest = `platform=iOS Simulator,id=${sim.udid},OS=${appc.version.format(sim.version, 2, 2)}`;
break;
}
}
}

if (!dest) {
// couldn't find a simulator!
// this shouldn't happen, but just in case, fall back to the selected simulator
dest = `platform=iOS Simulator,id=${this.simHandle.udid},OS=${appc.version.format(this.simHandle.version, 2, 2)}`;
}

// when building for the simulator, we need to specify a destination and a scheme (above)
// so that it can compile all targets (phone and watch targets) for the simulator
args.push('-destination', 'platform=iOS Simulator,id=' + this.simHandle.udid + ',OS=' + appc.version.format(this.simHandle.version, 2, 2));
args.push('-destination', dest);
args.push('ONLY_ACTIVE_ARCH=1');
}

Expand Down
203 changes: 29 additions & 174 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"ejs": "^2.6.2",
"fields": "0.1.24",
"fs-extra": "^8.0.1",
"ioslib": "^1.7.13",
"ioslib": "^1.7.14",
"klaw-sync": "^6.0.0",
"liveview": "^1.5.0",
"lodash.defaultsdeep": "^4.6.1",
Expand Down

0 comments on commit e0e6387

Please sign in to comment.