【性能测试】【移动端性能测试3】monkey压力测试

【性能测试】【移动端性能测试1】测试方法概要: https://www.cnblogs.com/haochuang/articles/12484846.html
【性能测试】【移动端性能测试2】移动端测试点:https://www.cnblogs.com/haochuang/articles/12484948.html
【性能测试】【移动端性能测试3】monkey压力测试:https://www.cnblogs.com/haochuang/p/12484923.html


 

 

关于移动端测试,monkey压力测试

  1. 安卓手机跟电脑安装豌豆荚
  2. 启动adb的服务(关闭服务    adb kill-server)    adb devices
  3. 安装apk    adb install HelloWorld.apk
  4. 查看应用程序包名
    1. 只需要在连接手机后,输入命令:adb shell am monitor
    2. 在手机上点击程序,就能显示程序包名
  5. Monkey测试原理:
    1. Monkey是Android中的一个命令行工具,可以运行在模拟器里或实际设备中。它向系统发送伪随机的用户事件流(如按键输入、触摸屏输入、手势输入等),实现对正在开发的应用程序进行压力测试Monkey测试是一种为了测试软件的稳定性、健壮性的快速有效的方法。
    2. adb shell monkey -p 程序包名 -v --throttle 300 1000    执行1000次随机事件,间隔300毫秒    
  6.  显示具体app cpu占用情况    adb shell dumpsys cpuinfo|grep app包名
  7. 内存使用 情况    dumpsys meminfo|grep app包名
  8. 查看某个app日志/保存日志    adb shell logcat |findstr gov.pianzong.androidnga > C:\nag20190604.log
  9. 查看日志
    1. windows    tomcat/log/catalina.out
    2. linux    /var/log/secure
  10.  报错问题
    1.  could not read ok from ADB Server * failed to start daemon error: cannot connect to daemon    端口占用
    2.  解决:adb nodaemon server    netstat -ano | findstr "5037"    打开资源管理器关掉查出来的pid

摘自:https://www.cnblogs.com/wp950416/p/12172863.html

 

posted @ 2020-03-13 10:43  念槐聚  阅读(248)  评论(0)    收藏  举报