Skip to content

Commit 0898db9

Browse files
authored
add skipLogCapture (#355)
* add skipLogCapture * define setUpLogCapture
1 parent 62b49b6 commit 0898db9

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

lib/desired-caps.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ const desiredCapConstraints = {
125125
showIWDPLog: {
126126
isBoolean: true
127127
},
128+
skipLogCapture: {
129+
isBoolean: true
130+
},
128131
};
129132

130133
function desiredCapValidation (caps) {

lib/driver.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ class IosDriver extends BaseDriver {
351351

352352
await isolateSimulatorDevice(this.sim, this.opts);
353353
this.localConfig = await setLocaleAndPreferences(this.sim, this.opts, this.isSafari(), endSimulator);
354-
await this.startLogCapture(this.sim);
354+
await this.setUpLogCapture();
355355
await this.prelaunchSimulator();
356356
await this.startInstruments();
357357
await this.onInstrumentsLaunch();
@@ -368,7 +368,7 @@ class IosDriver extends BaseDriver {
368368
await utils.setBundleIdFromApp(this.opts);
369369
await this.createInstruments();
370370
await runRealDeviceReset(this.realDevice, this.opts);
371-
await this.startLogCapture();
371+
await this.setUpLogCapture();
372372
await this.installToRealDevice();
373373
await this.startInstruments();
374374
await this.onInstrumentsLaunch();
@@ -685,6 +685,19 @@ class IosDriver extends BaseDriver {
685685
}
686686
}
687687

688+
async setUpLogCapture () {
689+
if (this.caps.skipLogCapture) {
690+
logger.info("'skipLogCapture' is set. Skipping the collection of system logs and crash reports.");
691+
return;
692+
}
693+
694+
if (this.isRealDevice()) {
695+
await this.startLogCapture();
696+
} else {
697+
await this.startLogCapture(this.sim);
698+
}
699+
}
700+
688701
get realDevice () {
689702
this._realDevice = this._realDevice || this.getIDeviceObj();
690703
return this._realDevice;

0 commit comments

Comments
 (0)