mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00:00
android: don't try to disconnect devices which aren't connected
If you try to disconnect a device and there are none, certain versions of adb return 1, which leads to a TargetError and stops everything in its tracks. Try to mitigate this by checking if the device we want to disconnect is connected before we make the disconnect call. Signed-off-by: Chris Redpath <chris.redpath@arm.com>
This commit is contained in:
parent
cae239d1dc
commit
119fd7dc24
@ -291,7 +291,7 @@ def adb_disconnect(device):
|
||||
_check_env()
|
||||
if not device:
|
||||
return
|
||||
if ":" in device:
|
||||
if ":" in device and device in adb_list_devices():
|
||||
command = "adb disconnect " + device
|
||||
logger.debug(command)
|
||||
retval = subprocess.call(command, stdout=open(os.devnull, 'wb'), shell=True)
|
||||
|
Loading…
x
Reference in New Issue
Block a user