From f714dd39f1fc5fc64ba28d4c89b883b1a5db8953 Mon Sep 17 00:00:00 2001 From: Patrick Bellasi Date: Fri, 15 Jul 2016 11:18:09 +0100 Subject: [PATCH] android: avoid connect for USB target The "adb connect" command is not required for USB connected devices. This patch is a small update to use "adb connect" only for android devices accessed by IP address. Signed-off-by: Patrick Bellasi --- devlib/utils/android.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/devlib/utils/android.py b/devlib/utils/android.py index 0444b67..e6db188 100644 --- a/devlib/utils/android.py +++ b/devlib/utils/android.py @@ -265,6 +265,10 @@ def adb_get_device(timeout=None): def adb_connect(device, timeout=None, attempts=MAX_ATTEMPTS): _check_env() + # Connect is required only for ADB-over-IP + if "." not in device: + logger.debug('Device connected via USB, connect not required') + return tries = 0 output = None while tries <= attempts: