echo "adb wait-for-device"
adb wait-for-device
echo "*********************adb reboot bootloader *************"
adb reboot bootloader
echo "*********************fastboot devices ***************"
fastboot devices
echo "*********************fastboot flash *************"
fastboot flash boot boot.img
fastboot flash dtbo dtbo.img
fastboot flash system system.img
fastboot flash vendor vendor.img
fastboot flash cache cache.img
fastboot flash pesist persist.img
fastboot flash recovery recovery.img
fastboot flash userdata userdata.img
echo "*********************fastboot reboot *************"
fastboot reboot
echo "*********************adb wait-for-device******************"
adb wait-for-device
adb root
echo "adb logcat -v threadtime"
adb logcat -v threadtime >log.txt