diff --git a/packages/vscode-extension/src/devices/AndroidEmulatorDevice.ts b/packages/vscode-extension/src/devices/AndroidEmulatorDevice.ts index 3b6b3f494..56b010d05 100644 --- a/packages/vscode-extension/src/devices/AndroidEmulatorDevice.ts +++ b/packages/vscode-extension/src/devices/AndroidEmulatorDevice.ts @@ -387,7 +387,15 @@ export class AndroidEmulatorDevice extends DeviceBase { const extractPidFromLogcat = async (cancelToken: CancelToken) => new Promise((resolve, reject) => { const regexString = `Start proc ([0-9]{4}):${build.packageName}`; - const process = exec(ADB_PATH, ["logcat", "-e", regexString, "-T", "1"]); + const process = exec(ADB_PATH, [ + "-s", + this.serial!, + "logcat", + "-e", + regexString, + "-T", + "1", + ]); cancelToken.adapt(process); lineReader(process).onLineRead((line) => { @@ -422,7 +430,7 @@ export class AndroidEmulatorDevice extends DeviceBase { this.nativeLogsOutputChannel.clear(); const pid = await extractPidFromLogcat(this.nativeLogsCancelToken); - const process = exec(ADB_PATH, ["logcat", "--pid", pid]); + const process = exec(ADB_PATH, ["-s", this.serial!, "logcat", "--pid", pid]); this.nativeLogsCancelToken.adapt(process); lineReader(process).onLineRead(this.nativeLogsOutputChannel.appendLine);