You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2015/05/20 01:33:42 UTC
ios commit: CB-8906 - cordova run ios --target doesn't work
Repository: cordova-ios
Updated Branches:
refs/heads/4.0.x 957052bbf -> 01a5a9149
CB-8906 - cordova run ios --target doesn't work
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/01a5a914
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/01a5a914
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/01a5a914
Branch: refs/heads/4.0.x
Commit: 01a5a9149933f7198c64becb659fe5c23961d149
Parents: 957052b
Author: Shazron Abdullah <sh...@apache.org>
Authored: Tue May 19 16:34:38 2015 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Tue May 19 16:34:38 2015 -0700
----------------------------------------------------------------------
bin/templates/scripts/cordova/lib/run.js | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/01a5a914/bin/templates/scripts/cordova/lib/run.js
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/lib/run.js b/bin/templates/scripts/cordova/lib/run.js
index 151cad2..ec18289 100644
--- a/bin/templates/scripts/cordova/lib/run.js
+++ b/bin/templates/scripts/cordova/lib/run.js
@@ -50,7 +50,7 @@ module.exports.run = function (argv) {
// Valid values for "--target" (case sensitive):
var validTargets = ['iPhone-4s', 'iPhone-5', 'iPhone-5s', 'iPhone-6-Plus', 'iPhone-6',
'iPad-2', 'iPad-Retina', 'iPad-Air', 'Resizable-iPhone', 'Resizable-iPad'];
- if (args.target && validTargets.indexOf(args.target) < 0 ) {
+ if (!(args.device) && args.target && validTargets.indexOf(args.target) < 0 ) {
return Q.reject(args.target + ' is not a valid target for emulator');
}
@@ -81,7 +81,7 @@ module.exports.run = function (argv) {
// we're running on device/emulator
if (args.device) {
return checkDeviceConnected().then(function () {
- return deployToDevice(appPath);
+ return deployToDevice(appPath, args.target);
}, function () {
// if device connection check failed use emulator then
return deployToSim(appPath, args.target);
@@ -106,9 +106,13 @@ function checkDeviceConnected() {
* @param {String} appPath Path to application package
* @return {Promise} Resolves when deploy succeeds otherwise rejects
*/
-function deployToDevice(appPath) {
+function deployToDevice(appPath, target) {
// Deploying to device...
- return spawn('ios-deploy', ['-d', '-b', appPath]);
+ if (target) {
+ return spawn('ios-deploy', ['-d', '-b', appPath, '-i', target]);
+ } else {
+ return spawn('ios-deploy', ['-d', '-b', appPath]);
+ }
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org