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 1 commit
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
8 changes: 3 additions & 5 deletions lib/ParamedicTargetChooser.js
Expand Up @@ -128,12 +128,10 @@ ParamedicTargetChooser.prototype.chooseTargetForWindows = function (emulator, ta

ParamedicTargetChooser.prototype.chooseTargetForIOS = function (emulator, target) {
logger.info('cordova-paramedic: Choosing Target for iOS');
var simulatorModelId = util.getSimulatorModelId(this.cli, target);
var split = simulatorModelId.split(', ');
var device = split[0].trim();
var simId = util.getSimulatorId(simulatorModelId);
var deviceOSVersion = util.getSimulatorModelId(this.cli, target);
janpio marked this conversation as resolved.
Show resolved Hide resolved
var simId = util.getSimulatorId(deviceOSVersion);

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

module.exports = ParamedicTargetChooser;
8 changes: 4 additions & 4 deletions lib/paramedic.js
Expand Up @@ -190,9 +190,9 @@ ParamedicRunner.prototype.installPlatform = function () {
try {
// comment out the line where the gradle daemon is forced on
var gradleBuilderFile = path.join(self.tempFolder.name, 'platforms/android/cordova/lib/builders/GradleBuilder.js');
var sedResult = shell.sed('-i',
/args\.push\('\-Dorg\.gradle\.daemon=true'\);/,
'//args.push(\'-Dorg.gradle.daemon=true\');',
var sedResult = shell.sed('-i',
/args\.push\('\-Dorg\.gradle\.daemon=true'\);/,
'//args.push(\'-Dorg.gradle.daemon=true\');',
gradleBuilderFile);
if (sedResult.indexOf('//args.push(\'-Dorg.gradle.daemon=true\');') >= 0) {
logger.info('cordova-paramedic: success!');
Expand Down Expand Up @@ -464,7 +464,7 @@ ParamedicRunner.prototype.getCommandForStartingTests = function () {
})
.then(function(targetObj){
self.targetObj = targetObj;
cmd += ' --target ' + self.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