#!/bin/bash
do_reset() {
adb wait-for-device
adb root
adb wait-for-device
adb shell "touch /data/auto_reset_file"
adb shell "echo --wipe_data >/cache/recovery/command"
adb shell sync
adb reboot recovery
}
check_boot() {
adb wait-for-device
echo "find device,wait for boot completed"
adb root
adb wait-for-device
while [ "`adb shell getprop sys.boot_completed`" != "1" ]
do
sleep 1
done
echo "boot completed,check if test file exists"
adb shell "[ ! -f /data/auto_reset_test_file ] && echo 'Can not find test file in /data/ ,reset success' "
}
for i in `seq 100`
do
echo "-------------------`date` start do reset $i-------------------------"
do_reset
echo "reset command send,wait for reset done"
check_boot
done
关于adb工具的脚本
最新推荐文章于 2024-09-09 09:25:44 发布