Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async startCapture () {
if (this.udid) { // if we have a real device
return await this.startCaptureRealDevice();
}
// otherwise, if we have a simulator...
let xcodeVersion = await xcode.getVersion();
let ver = parseInt(xcodeVersion.split('.')[0], 10);
if (ver < 5) {
logger.debug('Starting iOS6.* simulator log capture');
this.proc = new SubProcess('tail', ['-f', '-n', '1', '/var/log/system.log']);
await this.finishStartingLogCapture();
return;
}
let logsPath;
if (ver >= 6) {
logger.debug('Starting iOS 8.*/9.* simulator log capture');
if (_.isUndefined(this.simUdid)) {
logger.errorAndThrow('iOS 8*/9.* log capture requires a sim udid');
}