mirror of
https://github.com/appium/appium.git
synced 2026-02-12 21:10:10 -06:00
Merge pull request #1546 from jlipps/master
go ahead and kill sims before launching a new one
This commit is contained in:
@@ -632,14 +632,17 @@ IOS.prototype.setDeviceAndLaunchSimulator = function(cb) {
|
||||
cb(new Error(msg));
|
||||
} else {
|
||||
|
||||
var iosDeviceString = this.getDeviceString();
|
||||
var isiPhone = iosDeviceString.toLowerCase().indexOf("ipad") === -1;
|
||||
this.endSimulator(function(err) {
|
||||
if (err) return cb(err);
|
||||
var iosDeviceString = this.getDeviceString();
|
||||
var isiPhone = iosDeviceString.toLowerCase().indexOf("ipad") === -1;
|
||||
|
||||
logger.debug("Launching device: " + iosDeviceString);
|
||||
var iosSimArgs = ["-SimulateDevice", iosDeviceString];
|
||||
this.iosSimProcess = spawn(iosSimPath, iosSimArgs);
|
||||
logger.debug("Launching device: " + iosDeviceString);
|
||||
var iosSimArgs = ["-SimulateDevice", iosDeviceString];
|
||||
this.iosSimProcess = spawn(iosSimPath, iosSimArgs);
|
||||
|
||||
this.setDeviceTypeInInfoPlist(isiPhone ? 1 : 2, cb);
|
||||
this.setDeviceTypeInInfoPlist(isiPhone ? 1 : 2, cb);
|
||||
}.bind(this));
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -763,7 +766,11 @@ IOS.prototype.endSimulator = function(cb) {
|
||||
} else {
|
||||
var cmd = 'killall -9 "iPhone Simulator"';
|
||||
exec(cmd, { maxBuffer: 524288 }, function(err) {
|
||||
cb(err);
|
||||
if (err && err.message.indexOf('matching processes') === -1) {
|
||||
cb(err);
|
||||
} else {
|
||||
cb();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user