在ubuntu中执行此脚本,usb连接Android 设备(打开debug模式),控制Android 设备循环执行亮,打开app,灭屏测试
#!/bin/bash
for a in {1..10000}
do
adb shell input keyevent 26 #power键 亮屏
sleep 1 #等待1s
adb shell input swipe 500 700 500 50 #上滑 解锁
sleep 1
adb shell input keyevent 3 #adb 返回键 返回主界面
sleep 1
adb shell am start -n com.android.settings/.Settings #打开Settings app
sleep 1
printf "done number=%d\n" ${a}
done