Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CB-12813 ios Fix target chooser to use full target name #21

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 4 additions & 6 deletions lib/ParamedicTargetChooser.js
Expand Up @@ -133,13 +133,11 @@ class ParamedicTargetChooser {
chooseTargetForIOS (emulator, target) {
logger.info('cordova-paramedic: Choosing Target for iOS');

const simulatorModelId = utilities.getSimulatorModelId(this.cli, target);
const split = simulatorModelId.split(', ');
const device = split[0].trim();
const simId = utilities.getSimulatorId(simulatorModelId);
const deviceOSVersion = util.getSimulatorModelId(this.cli, target);
const simId = util.getSimulatorId(deviceOSVersion);

return Q({ target: device, simId: simId });
}
return Q({ target: deviceOSVersion, simId: simId });
}


module.exports = ParamedicTargetChooser;
2 changes: 1 addition & 1 deletion lib/paramedic.js
Expand Up @@ -394,7 +394,7 @@ class ParamedicRunner {
return Q().then(() => paramedicTargetChooser.chooseTarget(/* useEmulator= */true, /* preferredTarget= */this.config.getTarget()))
.then((targetObj) => {
this.targetObj = targetObj;
cmd += ' --target ' + this.targetObj.target;
cmd += ' --target "' + self.targetObj.target + '"';

// CB-11472 In case of iOS provide additional '--emulator' flag, otherwise
// 'cordova run ios --target' would hang waiting for device with name
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/utilities.js 100644 → 100755
Expand Up @@ -64,7 +64,7 @@ function getSimulatorsFolder () {
function getSimulatorModelId (cli, target) {
var findSimCommand;
if (target) {
findSimCommand = cli + ' run --list --emulator' + module.exports.PARAMEDIC_COMMON_CLI_ARGS + ' | grep ' + target + ' | tail -n1';
findSimCommand = cli + ' run --list --emulator' + module.exports.PARAMEDIC_COMMON_CLI_ARGS + ' | grep "' + target + '" | tail -n1';
} else {
findSimCommand = cli + ' run --list --emulator' + module.exports.PARAMEDIC_COMMON_CLI_ARGS + ' | grep ^iPhone | tail -n1';
}
Expand Down