Permalink
Browse files

Add additional valid targets for simulation

Targets Added:
- iPhone-6s
- iPhone-6s-Plus
- iPad-Air-2
- iPad-Pro
  • Loading branch information...
1 parent 40b4f93 commit 07fd9379872b949ce651efb9c4988b3d0bbb1b94 @busterc busterc committed Dec 21, 2015
Showing with 6 additions and 5 deletions.
  1. +6 −5 bin/templates/scripts/cordova/lib/run.js
@@ -41,7 +41,8 @@ module.exports.run = function (runOptions) {
// validate target device for ios-sim
// 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'];
+ 'iPhone-6s-Plus', 'iPhone-6s', 'iPad-2', 'iPad-Retina', 'iPad-Air', 'iPad-Air-2',
+ 'iPad-Pro', 'Resizable-iPhone', 'Resizable-iPad'];
if (!(runOptions.device) && runOptions.target && validTargets.indexOf(runOptions.target.split(',')[0]) < 0 ) {
return Q.reject(runOptions.target + ' is not a valid target for emulator');
}
@@ -96,22 +97,22 @@ module.exports.run = function (runOptions) {
/**
* Filters the args array and removes supported args for the 'run' command.
- *
+ *
* @return {Array} array with unsupported args for the 'run' command
*/
function filterSupportedArgs(args) {
var filtered = [];
var sargs = ['--device', '--emulator', '--nobuild', '--list', '--target', '--debug', '--release'];
var re = new RegExp(sargs.join('|'));
-
+
args.forEach(function(element) {
// supported args not found, we add
// we do a regex search because --target can be "--target=XXX"
if (element.search(re) == -1) {
filtered.push(element);
}
}, this);
-
+
return filtered;
}
@@ -145,7 +146,7 @@ function deployToDevice(appPath, target, extraArgs) {
* @return {Promise} Resolves when deploy succeeds otherwise rejects
*/
function deployToSim(appPath, target) {
- // Select target device for emulator. Default is 'iPhone-6'
+ // Select target device for emulator. Default is 'iPhone-6'
if (!target) {
return require('./list-emulator-images').run()
.then(function (emulators) {

0 comments on commit 07fd937

Please sign in to comment.