aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorborenet <borenet@google.com>2015-06-02 12:38:16 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-02 12:38:16 -0700
commit5aa5ea3831b955097e01be83020252c2134d59e4 (patch)
tree56f8ae3492d61dbaa2928c48dc34bf4c427c57f0
parentd26c9fa66c45b5a050580772acfbcc1b5271543e (diff)
downloadskia-5aa5ea3831b955097e01be83020252c2134d59e4.tar.gz
Add adb_wait_for_device script
BUG=skia:3718 Review URL: https://codereview.chromium.org/1149163003
-rwxr-xr-xplatform_tools/android/bin/adb_wait_for_device16
1 files changed, 16 insertions, 0 deletions
diff --git a/platform_tools/android/bin/adb_wait_for_device b/platform_tools/android/bin/adb_wait_for_device
new file mode 100755
index 000000000..52e16996c
--- /dev/null
+++ b/platform_tools/android/bin/adb_wait_for_device
@@ -0,0 +1,16 @@
+#!/bin/bash
+#
+# Wait for the device to be both attached and booted.
+
+SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+source $SCRIPT_DIR/android_setup.sh
+source $SCRIPT_DIR/utils/setup_adb.sh
+
+set -e
+set -x
+
+$ADB $DEVICE_SERIAL wait-for-device
+
+while [ "$($ADB $DEVICE_SERIAL shell getprop sys.boot_completed | tr -d '\r')" != "1" ]; do
+ sleep 5
+done