Skip to content

Commit

Permalink
update ios syslog capture for ios8
Browse files Browse the repository at this point in the history
  • Loading branch information
jlipps committed Oct 13, 2014
1 parent 8ef260b commit fc873e6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
25 changes: 19 additions & 6 deletions lib/devices/ios/ios-log.js
Expand Up @@ -13,6 +13,7 @@ require('date-utils');

var IosLog = function (opts) {
this.udid = opts.udid;
this.simUdid = opts.simUdid;
this.xcodeVersion = opts.xcodeVersion;
this.showLogs = opts.showLogs;
this.proc = null;
Expand Down Expand Up @@ -48,13 +49,25 @@ IosLog.prototype.startCapture = function (cb) {
this.proc = spawn("deviceconsole", ["-u", this.udid], {env: spawnEnv});
this.finishStartingLogCapture(cb);
} else {
if (parseInt(this.xcodeVersion.split(".")[0], 10) >= 5) {
logger.debug("Starting iOS 7.* simulator log capture");
var sim7LogsPath = path.resolve(process.env.HOME, "Library", "Logs", "iOS Simulator");
glob(sim7LogsPath + "/7.*/system.log", function (err, files) {
var ver = parseInt(this.xcodeVersion.split(".")[0], 10);
if (ver >= 5) {
var logsPath;
if (ver >= 6) {
logger.debug("Starting iOS 8.* simulator log capture");
if (_.isUndefined(this.simUdid)) {
return cb(new Error("iOS8 log capture requires a sim udid"));
}
logsPath = path.resolve(process.env.HOME, "Library", "Logs",
"CoreSimulator", this.simUdid);
} else {
logger.debug("Starting iOS 7.* simulator log capture");
logsPath = path.resolve(process.env.HOME, "Library", "Logs",
"iOS Simulator", "7.*");
}
glob(path.resolve(logsPath, "system.log"), function (err, files) {
if (err || files.length < 1) {
logger.error("Could not start log capture because no iOS 7 " +
"simulator logs could be found at " + sim7LogsPath + "/7.*. " +
logger.error("Could not start log capture because no iOS " +
"simulator logs could be found at " + logsPath + "/system.log" +
"Logging will not be functional for this run");
return cb();
} else {
Expand Down
1 change: 1 addition & 0 deletions lib/devices/ios/ios.js
Expand Up @@ -1526,6 +1526,7 @@ IOS.prototype.startLogCapture = function (cb) {
this.logs.crashlog = new iOSCrashLog();
this.logs.syslog = new iOSLog({
udid: this.args.udid
, simUdid: this.iOSSimUdid
, xcodeVersion: this.xcodeVersion
, showLogs: this.args.showSimulatorLog || this.args.showIOSLog
});
Expand Down

0 comments on commit fc873e6

Please sign in to comment.