camera的monkey导致指纹卡死。做以下测试模拟monkey过程。
#! /bin/bash
declare -i counter=0
declare -i count_max=9999999
function get_time(){
#echo $#
#echo $1
begin_s=`echo $1 | cut -d \. -f 1`
begin_ns=10#`echo $1 | cut -d \. -f 2`
#echo $2
end_s=`echo $2 | cut -d \. -f 1`
end_ns=10#`echo $2 | cut -d \. -f 2`
#echo $begin_s
#echo $begin_ns
#echo $end_s
#echo $end_ns
declare -i period_s=$end_s-$begin_s
declare -i period_ns=$end_ns-$begin_ns
#echo $period_ns
if(( period_ns < 0 )); then
#echo "ns<0"
period_s=period_s-1
period_ns=1000000000+period_ns
fi
result_period=$period_s.$period_ns
echo $result_period
#return $result_period
}
while [ $counter -lt $count_max ]
do
echo $counter
begin_s=`date +%s.%N`
adb shell am start -n com.zte.camera/com.zte.camera.CameraActivity
sleep 0.5
adb shell am force-stop com.zte.came