( deviceId: string, appBundleId: string, )
| 27 | } |
| 28 | |
| 29 | export async function resolveAndroidPid( |
| 30 | deviceId: string, |
| 31 | appBundleId: string, |
| 32 | ): Promise<string | null> { |
| 33 | const pidResult = await resolveAndroidAdbExecutor(androidDeviceForSerial(deviceId))( |
| 34 | ['shell', 'pidof', appBundleId], |
| 35 | { allowFailure: true }, |
| 36 | ); |
| 37 | const pid = pidResult.stdout.trim().split(/\s+/)[0]; |
| 38 | if (!pid || !/^\d+$/.test(pid)) return null; |
| 39 | return pid; |
| 40 | } |
| 41 | |
| 42 | export function readTrackedAndroidLogcatPid(pidPath: string | undefined): string | null { |
| 43 | const command = readStoredAppLogProcessMeta(pidPath)?.command; |
no test coverage detected