summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChase Qi <chase.qi@linaro.org>2017-03-01 18:28:35 +0800
committerChase Qi <chase.qi@linaro.org>2017-03-02 11:23:48 +0800
commitb308381ff047bc5f9a5744eb1da76e04fec5c150 (patch)
tree5fa1f410774b3c6feb83502338f04966c973abb8
parentf48aae09bf0133c409c92e8caab8c598b9ce63d2 (diff)
automated: android-test-lib: add install_latest_adb() and adb_root() functions
Change-Id: If83af404a7b819eecf5eb6359821e42cfbbfa029 Signed-off-by: Chase Qi <chase.qi@linaro.org>
-rwxr-xr-xautomated/lib/android-test-lib21
1 files changed, 21 insertions, 0 deletions
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"