サルテスト
9226 ワード
Android monkey
2013年9月8日に発表
herbertdai
今日の任務はサルを雇ってストレステストを手伝うことです.
$adb shell monkey -p [package name] -v [times]
package name:テストするパッケージ名
times:送信するランダム命令の数
?
View Code BASH 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
ADB="ziiadb"
times=1000
if [ -z $1 ]; then
echo "Input a number to repeat monkey e.g: go_monkey!.sh 1000"
exit 0
else
times=$1
fi
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo "+ GO! MONKEY! +"
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
cat AndroidManifest.xml | grep "package name"
package_name=$(cat AndroidManifest.xml |grep package= |cut -d "=" -f2|sed 's/"//g')
echo $package_name
$ADB shell monkey -p $package_name -v $times
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
ADB="ziiadb"
times=1000
if [ -z $1 ]; then
echo "Input a number to repeat monkey e.g: go_monkey!.sh 1000"
exit 0
else
times=$1
fi
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo "+ GO! MONKEY! +"
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
cat AndroidManifest.xml | grep "package name"
package_name=$(cat AndroidManifest.xml |grep package= |cut -d "=" -f2|sed 's/"//g')
echo $package_name
$ADB shell monkey -p $package_name -v $times