From b308381ff047bc5f9a5744eb1da76e04fec5c150 Mon Sep 17 00:00:00 2001 From: Chase Qi Date: Wed, 1 Mar 2017 18:28:35 +0800 Subject: automated: android-test-lib: add install_latest_adb() and adb_root() functions Change-Id: If83af404a7b819eecf5eb6359821e42cfbbfa029 Signed-off-by: Chase Qi --- automated/lib/android-test-lib | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/automated/lib/android-test-lib b/automated/lib/android-test-lib index c179a27..8677fea 100755 --- a/automated/lib/android-test-lib +++ b/automated/lib/android-test-lib @@ -1,7 +1,20 @@ #!/bin/sh +install_latest_adb() { + install_deps "wget zip" + wget -S --progress=dot:giga https://dl.google.com/android/repository/platform-tools-latest-linux.zip + unzip -q platform-tools-latest-linux.zip + export PATH=$PWD/platform-tools:$PATH + which adb + adb version +} + initialize_adb() { + which lava-lxc-device-add && lava-lxc-device-add + adb start-server + adb wait-for-device adb devices + if [ -z "${SN}" ]; then number="$(adb devices | grep -wc 'device')" if [ "${number}" -gt 1 ]; then @@ -22,6 +35,14 @@ initialize_adb() { fi } +adb_root() { + adb root & + sleep 10 + which lava-lxc-device-add && lava-lxc-device-add + adb wait-for-device + adb devices +} + wait_boot_completed() { [ "$#" -ne 1 ] && error_msg "Usage: wait_for_boot_completed timeout_in_seconds" timeout="$1" -- cgit v1.2.3