@@ -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.
7+WAIT_COMMAND="sleep 20"
7−while getopts s: opt; do
9+while getopts s:w: opt; do
8 case $opt in
10 case $opt in
10 export ANDROID_SERIAL=$OPTARG
12 export ANDROID_SERIAL=$OPTARG
@@ -26,7 +31,7 @@ helpers.unlock_unity()
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"