启动时间用这个脚本试试:
#! /bin/bash
if [ -f ~/result.txt ]; then
echo "" > result.txt
else
touch result.txt
fi
for ((i = 0; i < 50; i++))
do
adb shell am start -W -n com.pingan.pinganwifi/com.pingan.pinganwifi.home.MainActivity | grep "TotalTime" >> result.txt
adb shell am force-stop com.pingan.pinganwifi
done
awk -F
期待期待 306831008
大家有没有出现过 ios8 以上系统跑 Monkey 经常出现死机,而且只能强制关机重启。
每个事件都会有截图,感觉太多了,跑一晚上占用好多空间啊,是不是保持最新几十张就可以了(多的都删除)就像产的报告一样。
#64 楼 @vigossjjj 嗯,现在可以了,主要是受这个命令介绍影响了,那里面-a 是 app_name
MacBook-Pro:~ zhangqingyun$ crash_monkey
Usage: crash_monkey [options]
-a app_name Target Application, abs path to simulator-compiled .app file or the bundle_id of the desired target on device(Required)
-w device Target Device UDID(Required)
-n run_count How many times monkeys run(default: 2)
#60 楼 @gaoxing200851 我知道,已经执行到这一步,但就是调不起 idevicedebug,安装目录如下:单独执行报错:
suqiudandeMacBook-Pro:~ zhangqingyun$ idevicedebug -u 6cfbb3803dea494bb077344bcb38666a23756682 run PAAnyDoorSDK.app
Segmentation fault: 11
#58 楼 @gaoxing200851 可以用 t,不指定貌似默认是 100S,你的跳出去 app 后回来是怎么做到的,直接命令能执行吗?idevicedebug -u 6cfbb3803dea494bb077344bcb38666a23756682 run PAAnyDoorSDK.app
#55 楼 @vigossjjj 再补充下,idevicedebug 命令可以这样使用吧,报错如下:是不是可以断定 libimobiledevice 问题?
suqiudandeMacBook-Pro:~ zhangqingyun$ idevicedebug -u 6cfbb3803dea494bb077344bcb38666a23756682 run PAAnyDoorSDK.app
Segmentation fault: 11
#54 楼 @vigossjjj 应该还是安装 libimobiledevice 的问题,定位代码有跑到这一步:idevicedebug -u #{device} run #{app} >/dev/null 2>&1 &
但还是没有进程,libimobiledevice 的安装是用你的 reset.sh 有自动安装的
#52 楼 @vigossjjj 现在访问不了呢,我另一台电脑没有安装 idevicedebug,用命令执行 idevicedebug 也可以。另后台进程用 ps -al 可以吧?
#50 楼 @vigossjjj 目前只看到有如下的日志:貌似没有调用 idevicedebug,有没有像日志一样查看是否在调用 idevicedebug
2015-05-12 09:13:19 +0000 Debug: target.captureRectOnScreenWithName("{origin:{x:0.00,y:0.00}, size:{height:568.00,width:320.00}}", UIScreen, "monkey-2015-05-12T09-13-19-541Z")
2015-05-12 09:13:19 +0000 Screenshot captured.
App has hanged! Re-Launch it!
App has hanged! Re-Launch it!
App has hanged! Re-Launch it!
App has hanged! Re-Launch it!
App has hanged! Re-Launch it! Control+c 后出现有如下错误
Ctail finished: system.log
/Users/sky/Desktop/monkey/CrashMonkey4IOS-master/lib/crash_monkey/command_helper.rb:46:in each': Interrupt
block in run_process'
from /Users/sky/Desktop/monkey/CrashMonkey4IOS-master/lib/crash_monkey/command_helper.rb:46:in
from /Users/sky/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/open3.rb:217:in popen_run'
popen3'
from /Users/sky/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/open3.rb:99:in
from /Users/sky/Desktop/monkey/CrashMonkey4IOS-master/lib/crash_monkey/command_helper.rb:26:in run_process'
block (2 levels) in run_a_case'
from /Users/sky/Desktop/monkey/CrashMonkey4IOS-master/lib/crash_monkey/monkey_runner.rb:84:in
from /Users/sky/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/timeout.rb:66:in timeout'
block in run_a_case'
from /Users/sky/Desktop/monkey/CrashMonkey4IOS-master/lib/crash_monkey/monkey_runner.rb:83:in
from /Users/sky/Desktop/monkey/CrashMonkey4IOS-master/lib/crash_monkey/monkey_runner.rb:414:in watch_syslog'
run_a_case'
from /Users/sky/Desktop/monkey/CrashMonkey4IOS-master/lib/crash_monkey/monkey_runner.rb:81:in
from /Users/sky/Desktop/monkey/CrashMonkey4IOS-master/lib/crash_monkey/monkey_runner.rb:49:in block in run'
times'
from /Users/sky/Desktop/monkey/CrashMonkey4IOS-master/lib/crash_monkey/monkey_runner.rb:46:in
from /Users/sky/Desktop/monkey/CrashMonkey4IOS-master/lib/crash_monkey/monkey_runner.rb:46:in run'
from /Users/sky/Desktop/monkey/CrashMonkey4IOS-master/bin/crash_monkey:42:in
#44 楼 @vigossjjj libimobiledevice 已经安装,但后台没有 idevicedebug 进程。
#44 楼 @vigossjjj 没有,需要单独安装吗?deviceconsole, libimobiledevice 这两个需要如何安装?
#40 楼 @gaoxing200851 我的理解的有的,bin/crash_monkey_result 这个下面是最终的测试报告,会把那些需要的文件 Copy 过来,你的可以正常跑了吗?现在发现跳出 APP 不会回来,一直显示:App has hanged! Re-Launch it!
#36 楼 @vigossjjj Checkout 了一份新的代码和文档,现在可以正式跑起来了,有个疑问就是时间如何控制?主要是能过事件数来做控制吗?numberOfEvents
#36 楼 @vigossjjj 非常感谢,我现在试下,之前的错误已解决
@vigossjjj ,18 楼提的问题有方法解决不?
你自动生成的是 RVM,把 Crash_monkey 加入到环境变量中试下:export PATH=$PATH:/Users/sky/Desktop/monkey/CrashMonkey4IOS-master/bin
#14 楼 @gaoxing200851 我之前也是这样,是不是你没有改环境变量?
#16 楼 @vigossjjj 就是现在 IOS8.1 以上系统,跑完 Monkey 结束后,下次打开应用(不执行 Monkey)同样会自动在操作,7 的系统就没有问题,跑完结束下,下次打开应用不会自动操作
我执行 crash_monkey 时报如下错,MAC OS 和 Xcode 版本问题吗?
MAC OS:10.10.2
Xcode:6.3
/Users/sky/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in require': cannot load such file -- erubis (LoadError)
require'
from /Users/sky/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in
from /Users/sky/Desktop/monkey/CrashMonkey4IOS-master/lib/crash_monkey/monkey_runner.rb:7:in <module:UIAutoMonkey>'
'
from /Users/sky/Desktop/monkey/CrashMonkey4IOS-master/lib/crash_monkey/monkey_runner.rb:3:in
from /Users/sky/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in require'
require'
from /Users/sky/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in
from /Users/sky/Desktop/monkey/CrashMonkey4IOS-master/lib/crash_monkey.rb:2:in <top (required)>'
require'
from /Users/sky/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in
from /Users/sky/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in require'
from /Users/sky/Desktop/monkey/CrashMonkey4IOS-master/bin/crash_monkey:8:in
我在用 IOS8.1 以上系统跑 Monkey 时,跑完后再进入应用(大概跑几个小时),还会自动跑,只能关机。主要是我写了一个脚本,如果 Crash 后重启应用继跑,此时应用打开就会自动跑,还有 Monkey 加一起,就会出现一个莫名的问题,请问有什么方法解决么?