launchAndKill checks for simulator directories to be present before finally killing. Fixes 2612

This commit is contained in:
Jonah Stiennon
2014-06-17 17:48:33 -07:00
parent 4ed4c774ae
commit 7707867e1f

View File

@@ -607,10 +607,15 @@ IOS.prototype.setPreferences = function (cb) {
IOS.prototype.instantLaunchAndQuit = function (cb) {
logger.debug("Sim files for the " + this.iOSSDKVersion + " SDK do not yet exist, launching the sim " +
"to populate the applications and preference dirs");
var condition = function () {
return settings.simDirsExist(this.iOSSDKVersion);
}.bind(this);
this.setDeviceAndLaunchSimulator(function (err) {
if (err) return cb(err);
this.makeInstruments(function (err, instruments) {
instruments.launchAndKill(1000, function (err) {
instruments.launchAndKill(condition, function (err) {
if (err) return cb(err);
this.endSimulator(cb);
}.bind(this));