#!/bin/bash #---------------------fastboot-------------------------- #2019.03.12 readonly WAIT_FOR_DEVICE_TIME=2 wait_for_device() { local boot_completed printf "Waiting for device to come online ..." sleep ${WAIT_FOR_DEVICE_TIME}; adb wait-for-device boot_completed=$(adb shell getprop sys.boot_completed | tr -d '\r') while [[ "$boot_completed" != "1" ]]; do printf "." sleep $WAIT_FOR_DEVICE_TIME boot_completed=$(adb shell getprop sys.boot_completed 2>/dev/null||echo 0) done; sleep "$WAIT_FOR_DEVICE_TIME" echo "" } adb reboot bootloader fastboot flashing unlock fastboot reboot wait_for_device adb root adb disable-verity adb reboot wait_for_device adb root adb remount