diff --git a/lib/devices/ios/ios.js b/lib/devices/ios/ios.js index 7574c306b..98ec2f4d5 100644 --- a/lib/devices/ios/ios.js +++ b/lib/devices/ios/ios.js @@ -310,6 +310,7 @@ IOS.prototype.makeInstruments = function () { , launchTimeout: this.args.launchTimeout , flakeyRetries: this.args.backendRetries , logNoColors: this.args.logNoColors + , simulatorSdkAndDevice: this.getDeviceString() }); }; @@ -431,6 +432,11 @@ IOS.prototype.setLocale = function (cb) { var setLoc = function (err) { if (err) return cb(err); var iosSimLocalePath = path.resolve(__dirname, "../../../build/ios-sim-locale"); + if (this.args.fullReset) { + msg = "Cannot set locale information because a full-reset was requested"; + logger.error(msg); + return cb(new Error(msg)); + } if (fs.existsSync(iosSimLocalePath)) { helpers.getiOSSimulatorDirectories(function (err, pathList) { if (err || typeof pathList === 'undefined' || pathList.length < 1) { @@ -455,6 +461,7 @@ IOS.prototype.setLocale = function (cb) { cmd = (this.args.language) ? cmd + ' -language ' + this.args.language : cmd; cmd = (this.args.locale) ? cmd + ' -locale ' + this.args.locale : cmd; cmd = (this.args.calendarFormat) ? cmd + ' -calendar ' + this.args.calendarFormat : cmd; + logger.info("Setting locale with command " + cmd); exec(cmd, { maxBuffer: 524288 }, function (err) { if (err === null) { localeInfoWasSet = true; @@ -495,6 +502,13 @@ IOS.prototype.setPreferences = function (cb) { return cb(); } + if (this.args.fullReset) { + var msg = "Cannot set preferences because a full-reset was requested"; + logger.info(msg); + logger.error(msg); + return cb(new Error(msg)); + } + var settingsCaps = [ 'locationServicesEnabled', 'locationServicesAuthorized', @@ -548,7 +562,7 @@ IOS.prototype.setPreferences = function (cb) { }; IOS.prototype.instantLaunchAndQuit = function (cb) { - logger.info("Sim files for this SDK do not yet exist, launching the sim " + + logger.info("Sim files for the " + this.iOSSDKVersion + " SDK do not yet exist, launching the sim " + "to populate the applications and preference dirs"); this.setDeviceAndLaunchSimulator(function (err) { if (err) return cb(err); @@ -771,6 +785,9 @@ IOS.prototype.getDeviceString = function () { iosDeviceString += is64bit ? " (64-bit)" : ""; } } + if (this.iOSSDKVersion >= 7.1) { + iosDeviceString += " - Simulator - iOS " + this.args.version; + } return iosDeviceString; }; @@ -851,11 +868,11 @@ IOS.prototype.setDeviceAndLaunchSimulator = function (cb) { var setDeviceInfo = function (cb) { var iosDeviceString = this.getDeviceString(); var isiPhone = iosDeviceString.toLowerCase().indexOf("ipad") === -1; - logger.debug("Launching device: " + iosDeviceString); this.setDeviceTypeInInfoPlist(isiPhone ? 1 : 2, cb); }.bind(this); var startSim = function (cb) { + logger.debug("Launching device: " + iosDeviceString); var iosSimArgs = ["-SimulateDevice", this.getDeviceString()]; this.iosSimProcess = spawn(iosSimPath, iosSimArgs); var waitForSimulatorLogs = function (countdown) { @@ -872,14 +889,23 @@ IOS.prototype.setDeviceAndLaunchSimulator = function (cb) { waitForSimulatorLogs(10); }.bind(this); - async.series([ - this.endSimulator.bind(this), - cleanup, - setDeviceInfo, - startSim - ], function (err) { - cb(err); - }); + if (this.iOSSDKVersion < 7.1) { + async.series([ + this.endSimulator.bind(this), + cleanup, + setDeviceInfo, + startSim + ], function (err) { + cb(err); + }); + } else { + async.series([ + this.endSimulator.bind(this), + cleanup, + ], function (err) { + cb(err); + }); + } } } }; diff --git a/submodules/appium-instruments b/submodules/appium-instruments index 13df80bc8..9d7fb5802 160000 --- a/submodules/appium-instruments +++ b/submodules/appium-instruments @@ -1 +1 @@ -Subproject commit 13df80bc808e79c8b2537ad07b869321266cb271 +Subproject commit 9d7fb58026e98e09e3d1342ef44830dc8ad63b04