Skip to content

Commit cf97305

Browse files
committed
Fix bash escaping and set transport
1 parent 0445d31 commit cf97305

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

app/development/scripts/provision_emulator.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ fi
5959
ADB="$ANDROID_HOME/platform-tools/adb -s $EMULATOR_DEVICE_NAME"
6060

6161
echo "Waiting for emulator to boot..."
62-
$ADB wait-for-device shell "while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;"
62+
$ADB wait-for-device shell "while [[ -z \$(getprop sys.boot_completed) ]]; do sleep 1; done;"
6363

6464
echo "Provisioning emulator for write access to '/system'..."
6565
$ADB root
@@ -68,14 +68,14 @@ $ADB remount # remount /system as writable
6868

6969
echo "Rebooting emulator..."
7070
$ADB reboot # need to reboot first time we remount
71-
$ADB wait-for-device shell "while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;"
71+
$ADB wait-for-device shell "while [[ -z \$(getprop sys.boot_completed) ]]; do sleep 1; done;"
7272

7373
echo "Provisioning emulator for Seedvault..."
7474
"$SCRIPT_DIR"/install_app.sh
7575

7676
echo "Rebooting emulator..."
7777
$ADB reboot
78-
$ADB wait-for-device shell "while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;"
78+
$ADB wait-for-device shell "while [[ -z \$(getprop sys.boot_completed) ]]; do sleep 1; done;"
7979

8080
echo "Disabling backup..."
8181
$ADB shell bmgr enable false
@@ -100,4 +100,10 @@ $ADB shell rm /sdcard/backup.tar.gz
100100
# sometimes a system dialog (e.g. launcher stopped) is showing and taking focus
101101
$ADB shell am broadcast -a android.intent.action.CLOSE_SYSTEM_DIALOGS
102102

103+
echo "Enabling bmgr and setting transport"
104+
$ADB shell bmgr enable true
105+
# wait for the transport to be recognized by android
106+
adb shell "while [[ -z \$(bmgr list transports | grep seedvault) ]]; do sleep 1; done;"
107+
$ADB shell bmgr transport com.stevesoltys.seedvault.transport.ConfigurableBackupTransport
108+
103109
echo "Emulator '$EMULATOR_NAME' has been provisioned with Seedvault!"

0 commit comments

Comments
 (0)