@@ -58,20 +58,6 @@ export class LogcatHelper implements Mobile.ILogcatHelper {
58
58
}
59
59
}
60
60
61
- private async getLogcatStream ( deviceIdentifier : string , pid ?: string ) {
62
- const device = await this . $devicesService . getDevice ( deviceIdentifier ) ;
63
- const minAndroidWithLogcatPidSupport = "7.0.0" ;
64
- const isLogcatPidSupported = semver . gte ( semver . coerce ( device . deviceInfo . version ) , minAndroidWithLogcatPidSupport ) ;
65
- const adb : Mobile . IDeviceAndroidDebugBridge = this . $injector . resolve ( DeviceAndroidDebugBridge , { identifier : deviceIdentifier } ) ;
66
- const logcatCommand = [ "logcat" ] ;
67
-
68
- if ( pid && isLogcatPidSupported ) {
69
- logcatCommand . push ( `--pid=${ pid } ` ) ;
70
- }
71
- const logcatStream = await adb . executeCommand ( logcatCommand , { returnChildProcess : true } ) ;
72
- return logcatStream ;
73
- }
74
-
75
61
public async dump ( deviceIdentifier : string ) : Promise < void > {
76
62
const adb : Mobile . IDeviceAndroidDebugBridge = this . $injector . resolve ( DeviceAndroidDebugBridge , { identifier : deviceIdentifier } ) ;
77
63
const logcatDumpStream = await adb . executeCommand ( [ "logcat" , "-d" ] , { returnChildProcess : true } ) ;
@@ -101,6 +87,20 @@ export class LogcatHelper implements Mobile.ILogcatHelper {
101
87
delete this . mapDevicesLoggingData [ deviceIdentifier ] ;
102
88
}
103
89
}
90
+
91
+ private async getLogcatStream ( deviceIdentifier : string , pid ?: string ) {
92
+ const device = await this . $devicesService . getDevice ( deviceIdentifier ) ;
93
+ const minAndroidWithLogcatPidSupport = "7.0.0" ;
94
+ const isLogcatPidSupported = ! ! device . deviceInfo . version && semver . gte ( semver . coerce ( device . deviceInfo . version ) , minAndroidWithLogcatPidSupport ) ;
95
+ const adb : Mobile . IDeviceAndroidDebugBridge = this . $injector . resolve ( DeviceAndroidDebugBridge , { identifier : deviceIdentifier } ) ;
96
+ const logcatCommand = [ "logcat" ] ;
97
+
98
+ if ( pid && isLogcatPidSupported ) {
99
+ logcatCommand . push ( `--pid=${ pid } ` ) ;
100
+ }
101
+ const logcatStream = await adb . executeCommand ( logcatCommand , { returnChildProcess : true } ) ;
102
+ return logcatStream ;
103
+ }
104
104
}
105
105
106
106
$injector . register ( "logcatHelper" , LogcatHelper ) ;
0 commit comments