@@ -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