Fixes from code review on #1161

This commit is contained in:
Dan Cuellar
2013-09-21 13:12:23 -07:00
parent 8d39ff50f5
commit 4b7696ee76
+4 -2
View File
@@ -317,20 +317,22 @@ IOS.prototype.onInstrumentsExit = function(code, traceDir, launchCb) {
};
IOS.prototype.detectUdid = function (cb) {
if (this.udid !== null && this.udid == "auto") {
if (this.udid !== null && this.udid === "auto") {
logger.info("Auto-detecting iOS udid...");
var udidetectPath = path.resolve(__dirname, "../build/udidetect/udidetect");
var udiddetectProc = exec(udidetectPath, { maxBuffer: 524288, timeout: 3000 }, function(err, stdout) {
if (stdout && stdout.length > 2) {
this.udid = stdout.replace("\n","");
logger.info("Detected udid as " + this.udid);
cb();
} else {
logger.error("Could not detect udid.");
cb(new Error("Could not detect udid."));
}
cb();
}.bind(this));
udiddetectProc.on('timeout', function () {
logger.error("Timed out trying to detect udid.");
cb(new Error("Timed out trying to detect udid."));
});
} else {
cb();