on xenial help sign in
Add -w argument to specify settle command
0acff01Michael Terry
tools/unlock-device+7−2
@@ -4,11 +4,16 @@
4# Our goal here is to get an Ubuntu Touch device into a testable unlocked state.
4# Our goal here is to get an Ubuntu Touch device into a testable unlocked state.
5# This will include a reboot.
5# This will include a reboot.
6
6
7+WAIT_COMMAND="sleep 20"
8+
7−while getopts s: opt; do
9+while getopts s:w: opt; do
8 case $opt in
10 case $opt in
9 s)
11 s)
10 export ANDROID_SERIAL=$OPTARG
12 export ANDROID_SERIAL=$OPTARG
11 ;;
13 ;;
14+ w)
15+ WAIT_COMMAND=$OPTARG
16+ ;;
12 esac
17 esac
13done
18done
14
19
@@ -26,7 +31,7 @@ helpers.unlock_unity()
26adb reboot
31adb reboot
27sleep 5
32sleep 5
28adb "wait-for-device"
33adb "wait-for-device"
29−sleep 20
34+eval "$WAIT_COMMAND"
30UNLOCK_OUTPUT=$(adb shell "sudo -u phablet -i python3 -c '$UNLOCK_SCRIPT'" 2>&1)
35UNLOCK_OUTPUT=$(adb shell "sudo -u phablet -i python3 -c '$UNLOCK_SCRIPT'" 2>&1)
31if echo "$UNLOCK_OUTPUT" | grep 'Greeter unlocked' >/dev/null; then
36if echo "$UNLOCK_OUTPUT" | grep 'Greeter unlocked' >/dev/null; then
32 echo "I: Unlock passed"
37 echo "I: Unlock passed"