关于adb工具的脚本

时间:2025-01-28 08:06:20
#!/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