Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: build/android/adb_device_functions.sh

Issue 10837180: Added reboot phone step to android testers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moved reboot to before tests Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | build/android/buildbot_functions.sh » ('j') | build/android/buildbot_functions.sh » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/adb_device_functions.sh
diff --git a/build/android/adb_device_functions.sh b/build/android/adb_device_functions.sh
index 257d80007fa478a197b86c459d9881b08d27382a..a8a0c8f56421218bb80c2d18039072ff1d88052f 100755
--- a/build/android/adb_device_functions.sh
+++ b/build/android/adb_device_functions.sh
@@ -20,7 +20,7 @@ adb_all() {
echo "Example: adb_all install Chrome.apk"
return 1
fi
- local DEVICES=$(adb_blocking_get_devices)
+ local DEVICES=$(adb_get_devices -b)
local NUM_DEVICES=$(echo $DEVICES | wc -w)
if (( $NUM_DEVICES > 1 )); then
echo "Looping over $NUM_DEVICES devices"
@@ -42,7 +42,7 @@ adb_device_loop() {
'adb shell cat /data/local.prop)"'
return 1
fi
- local DEVICES=$(adb_blocking_get_devices)
+ local DEVICES=$(adb_get_devices -b)
# Do not change DEVICE variable name - part of api
for DEVICE in $DEVICES; do
DEV_TYPE=$(adb -s $DEVICE shell getprop ro.product.device | sed 's/\r//')
@@ -67,19 +67,21 @@ wipe_all_devices() {
echo "If fastboot fails, run: 'sudo adduser $(whoami) plugdev'"
fi
- local DEVICES=$(adb_blocking_get_devices)
+ local DEVICES=$(adb_get_devices -b)
if [[ $1 != '-f' ]]; then
echo "This will ERASE ALL DATA from $(echo $DEVICES | wc -w) device."
read -p "Hit enter to continue"
fi
- _adb_multi "$DEVICES" "root"
- _adb_multi "$DEVICES" "wait-for-device"
_adb_multi "$DEVICES" "reboot bootloader"
+ # Subshell to isolate job list
+ (
for DEVICE in $DEVICES; do
- fastboot_erase $DEVICE
+ fastboot_erase $DEVICE &
done
+ wait
+ )
# Reboot devices together
for DEVICE in $DEVICES; do
@@ -106,10 +108,11 @@ fastboot_erase() {
fastboot $SERIAL erase userdata
}
-# Block until adb detects a device, then return list of serials
-adb_blocking_get_devices() {
+# Get list of devices connected via adb
+# Args: -b block until adb detects a device
+adb_get_devices() {
local DEVICES="$(adb devices | grep 'device$')"
- if [[ -z $DEVICES ]]; then
+ if [[ -z $DEVICES && $1 == '-b' ]]; then
echo '- waiting for device -' >&2
local DEVICES="$(adb wait-for-device devices | grep 'device$')"
fi
« no previous file with comments | « no previous file | build/android/buildbot_functions.sh » ('j') | build/android/buildbot_functions.sh » ('J')

Powered by Google App Engine
This is Rietveld 408576698