diff options
author | Chase Qi <chase.qi@linaro.org> | 2017-08-24 10:14:33 +0800 |
---|---|---|
committer | Chase Qi <chase.qi@linaro.org> | 2017-08-24 10:14:33 +0800 |
commit | 4f25e5a7071614fe56f5282c72a368f7808a0256 (patch) | |
tree | e93363522fb735bdf14ec745e9e79aecd14966de /automated/lib | |
parent | 35f8f45b0f42bdd011e2809cc45bad86573e22e1 (diff) |
android: print USB bus and device info for adb debugging
Print USB bus and device info for the following 3 conditions.
* Before adb initialization
* After 'adb root' command executed
* When adb connectivity issue detected
Change-Id: Id7ad9bf1238e5f55e3752680d0ae90bcd2c9b3d6
Signed-off-by: Chase Qi <chase.qi@linaro.org>
Diffstat (limited to 'automated/lib')
-rwxr-xr-x | automated/lib/android-test-lib | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/automated/lib/android-test-lib b/automated/lib/android-test-lib index 65b6420..56a4f8f 100755 --- a/automated/lib/android-test-lib +++ b/automated/lib/android-test-lib @@ -9,7 +9,19 @@ install_latest_adb() { adb version } +adb_debug_info() { + info_msg "'find /dev/bus/usb' output" + find /dev/bus/usb + if which lsusb; then + info_msg "'lsusb' output" + lsusb + else + info_msg "usbutils not installed. 'lsusb' skipped!" + fi +} + initialize_adb() { + adb_debug_info adb start-server adb devices @@ -20,9 +32,6 @@ initialize_adb() { elif [ "${number}" -eq 1 ]; then ANDROID_SERIAL="$(adb get-serialno)" else - # try to debug the problem with missing adb device - which lsusb && lsusb - which find && find /dev/ error_msg "Device NOT found" fi fi @@ -44,6 +53,8 @@ adb_root() { adb root adb wait-for-device adb devices + # After adb root, device number within the USB bus changes. + adb_debug_info fi } |