Skip to content

Commit

Permalink
Merge pull request #5541 from cb1kenobi/timob-16652
Browse files Browse the repository at this point in the history
[TIMOB-16652] Fixed bug when running an ios build for all connected devi...
  • Loading branch information
srahim committed Apr 1, 2014
2 parents e68af56 + e05fb64 commit 683bf8a
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions iphone/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -873,27 +873,29 @@ iOSBuilder.prototype.validate = function (logger, config, cli) {
// args based on the sim profile values
if ((this.target == 'device' || this.target == 'simulator') && deviceId) {
for (var i = 0, l = this.devices.length; i < l; i++) {
if (this.devices[i].id == deviceId) {
if (this.target == 'device') {
if (this.devices[i].id != 'itunes' && version.lt(this.devices[i].productVersion, this.minIosVer)) {
logger.error(__('This app does not support the device "%s"', this.devices[i].name) + '\n');
logger.log(__("The device is running iOS %s, however the app's the minimum iOS version is set to %s", this.devices[i].productVersion.cyan, version.format(this.minIosVer, 2, 3).cyan));
logger.log(__('In order to install this app on this device, lower the %s to %s in the tiapp.xml:', '<min-ios-ver>'.cyan, version.format(this.devices[i].productVersion, 2, 2).cyan));
logger.log();
logger.log('<ti:app xmlns:ti="http://ti.appcelerator.org">'.grey);
logger.log(' <ios>'.grey);
logger.log((' <min-ios-ver>' + version.format(this.devices[i].productVersion, 2, 2) + '</min-ios-ver>').magenta);
logger.log(' </ios>'.grey);
logger.log('</ti:app>'.grey);
logger.log();
process.exit(0);
}
} else if (this.target == 'simulator') {
cli.argv.retina = !!this.devices[i].retina;
cli.argv.tall = !!this.devices[i].tall;
cli.argv['sim-64bit'] = !!this.devices[i]['64bit'];
cli.argv['sim-type'] = this.devices[i].type;
if (this.target == 'device') {
if (this.devices[i].id == 'all' || this.devices[i].id == 'itunes') {
continue;
}

if ((deviceId == 'all' || deviceId == this.devices[i].id) && version.lt(this.devices[i].productVersion, this.minIosVer)) {
logger.error(__('This app does not support the device "%s"', this.devices[i].name) + '\n');
logger.log(__("The device is running iOS %s, however the app's the minimum iOS version is set to %s", this.devices[i].productVersion.cyan, version.format(this.minIosVer, 2, 3).cyan));
logger.log(__('In order to install this app on this device, lower the %s to %s in the tiapp.xml:', '<min-ios-ver>'.cyan, version.format(this.devices[i].productVersion, 2, 2).cyan));
logger.log();
logger.log('<ti:app xmlns:ti="http://ti.appcelerator.org">'.grey);
logger.log(' <ios>'.grey);
logger.log((' <min-ios-ver>' + version.format(this.devices[i].productVersion, 2, 2) + '</min-ios-ver>').magenta);
logger.log(' </ios>'.grey);
logger.log('</ti:app>'.grey);
logger.log();
process.exit(0);
}
} else if (this.target == 'simulator' && this.devices[i].id == deviceId) {
cli.argv.retina = !!this.devices[i].retina;
cli.argv.tall = !!this.devices[i].tall;
cli.argv['sim-64bit'] = !!this.devices[i]['64bit'];
cli.argv['sim-type'] = this.devices[i].type;
break;
}
}
Expand Down

0 comments on commit 683bf8a

Please sign in to comment.