自动开关机脚本

reboot_test.sh

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

#Navy add for reboot/factory-reset test

#adb reboot
#adb reboot factory-reset

#默认开关机测试次数
rebootNum=5
#开关机设备ID号
deviceId=null
#开关机间隔时间
rebootInterval=30

if [ $# = 1 ];then
   rebootNum=$1
elif [ $# = 2 ];then
   rebootNum=$1
   deviceId=$2
fi

i=1
while [ $i -le $rebootNum ]
do
if [[ $deviceId =~ "null" ]];then
   echo "reboot test num" $i
   adb reboot
else
   echo "reboot "$deviceId" test num "$i
   adb -s $deviceId reboot
fi
sleep $rebootInterval
let i++
done
0%