Android shell脚本运用
来源:互联网 发布:音箱测试软件app 编辑:程序博客网 时间:2024/06/04 18:47
执行sh脚本
chmod +x filename
./filename
或者source filename
自动运行monkey
monkey.sh
#!/bin/bash. ~/.envlogdir=~/monkeyreportmkdir -p $logdirecho "monkey test" >> $logdir/log.txtdate >> $logdir/log.txtwhich adb >> $logdir/log.txtecho ""seed=`date +%s`count=18000cmd="adb shell"pkg=com.xx.app.phoneoutput=""let i=1for arg in $@do let i=$i+1 case $arg in --s) eval device=\$$i cmd="adb -s $device shell" ;; --d) pkg=com.xx.app.phone ;; --o) output="$logdir/`date +%H:%M:%S`" ;; --pos) pkg=com.xx.app.pos ;; --pad) pkg=com.xx.app.pad ;; esacdone$cmd am force-stop $pkgif [ $output ]; then $cmd monkey -p $pkg -v --throttle 25 -s $seed $count > $output grep -q Exception $output if [ $? -eq 1 ];then rm $output fielse $cmd monkey -p $pkg -v --throttle 25 -s $seed $countfi
自动进入调试设备某应用数据库目录
adb_enter_db.sh
#!/bin/bash dev=device_namepkg=com.xx.app.xxif [ $1 ]; then pkg=$1;fiif [ $2 ]; then dev=$2;fiecho $dev $pkgadb -s $dev pull data/data/$pkg/databases/
执行时输入:./adb_enter_db.sh pkg_name dev_name
将bdb格式文件转换成sqlite
#!/bin/bash src=xx.bdbdst=xx.sqliteif [ $1 ]; then src=$1;fiif [ $2 ]; then dst=$2;fiif [ -f $dst ]; then rm $dst;fi# sqlite3 xx.bdb .dump | sqlite3 xx.sqlitesqlite3 $src .dump | sqlite3 $dst
阅读全文
0 0
- Android shell脚本运用
- shell脚本的组合运用
- Android 执行shell脚本
- android执行shell脚本
- Android执行shell脚本
- Android shell 脚本执行
- Android执行shell脚本
- Android执行shell脚本
- Android shell 脚本
- Android shell 脚本
- 一个简单的shell脚本程序(运用expr命令)
- Android linux shell 脚本书写
- android清理进程 shell脚本
- android jni 执行 shell脚本
- Android开机执行shell脚本
- Android开机执行shell脚本
- Android开机执行shell脚本
- Android shell脚本的使用
- 日志信息log
- JdbcBaseReview 系列之JdbcDBUtils(四)-----jbdc的jar包
- oj 2968: C语言习题5.20--递归方法实现逆序
- 桌面路径
- jdk安装
- Android shell脚本运用
- 傻傻分不清的 slice,split 和splice
- 阿里云服务器上安装jdk+tomcat+mysql的过程
- 使用bufferedreader 的readline()读取文件
- 千万级并发连接的秘密
- JVM中对象的死亡判定
- 从请求管道深入剖析HttpModule的实现机制,有图有真相
- 文件描述符
- VS2013 MFC checkbox 控件默认选中