Skip to content

Commit 3ac0205

Browse files
committed
refactor: move the private method after the public methods
1 parent 64ae5cf commit 3ac0205

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

lib/common/mobile/android/logcat-helper.ts

+14-14
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,6 @@ export class LogcatHelper implements Mobile.ILogcatHelper {
5858
}
5959
}
6060

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 = !!device.deviceInfo.version && 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-
7561
public async dump(deviceIdentifier: string): Promise<void> {
7662
const adb: Mobile.IDeviceAndroidDebugBridge = this.$injector.resolve(DeviceAndroidDebugBridge, { identifier: deviceIdentifier });
7763
const logcatDumpStream = await adb.executeCommand(["logcat", "-d"], { returnChildProcess: true });
@@ -101,6 +87,20 @@ export class LogcatHelper implements Mobile.ILogcatHelper {
10187
delete this.mapDevicesLoggingData[deviceIdentifier];
10288
}
10389
}
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+
}
104104
}
105105

106106
$injector.register("logcatHelper", LogcatHelper);

0 commit comments

Comments
 (0)