From 5f9fab3f6a96888b182b231a4595a469adac2105 Mon Sep 17 00:00:00 2001 From: Ihor Zvieriev Date: Mon, 9 Oct 2023 14:01:33 +0200 Subject: [PATCH] Fix the device selection failure If the adb server was not started yet, the output from adb devices would contain the adb start log, which caused device selection failure when single device attached. This change fixes that Change-Id: If4f15729aa9bb2b3f5ae8d49cf77089079c4b2f0 --- android/scripts/gfxrecon.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/android/scripts/gfxrecon.py b/android/scripts/gfxrecon.py index 9893177126..e552426c61 100644 --- a/android/scripts/gfxrecon.py +++ b/android/scripts/gfxrecon.py @@ -60,7 +60,8 @@ class DeviceSelectionException(Exception): pass def QueryAvailableDevices(): - devices = subprocess.getoutput(adb_devices).splitlines()[1:] + result = subprocess.run(shlex.split(adb_devices, posix='win' not in sys.platform), capture_output=True, check=True) + devices = result.stdout.decode().strip().splitlines()[1:] return [device.split('\t')[0] for device in devices] def CheckDeviceSelection():