用例的主要步骤如下:
1. 开机到主界面
2. 使 屏幕灭 执行 adb shell input keyevent 223
3. 查看屏幕状态。应显示off 执行 adb shell "dumpsys power | grep 'Display Power' "
4. 使 屏幕亮 执行 adb shell input keyevent 224
5. 查看屏幕状态。应显示on 执行 adb shell "dumpsys power | grep 'Display Power' "
6.重复步骤2-5
#!/bin/bash
i=""
SN=$1
number=$2
adb_command10(){
for a in `seq $number`
do
adb -s $SN shell input keyevent 223
sleep 3
adb -s $SN shell "dumpsys power | grep 'Display Power' "
sleep 3
adb -s $SN shell input keyevent 224
sleep 3
adb -s $SN shell "dumpsys power | grep 'Display Power' "
echo "第$a轮测试完成"
sleep 3
done
}
if [ "$number" != "$i" ] && [ $number -gt 0 ]
then
start_time=`date +%s`
adb_command10
end_time=`date +%s`
echo