Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
vigossjjj committed Jun 2, 2015
1 parent a7321be commit 0c8bd92
Showing 1 changed file with 25 additions and 21 deletions.
46 changes: 25 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,48 @@
# CrashMonkey4IOS
iOS Monkey Test Tool.

###改进点:
1. 原先的CrashMonkey只支持iPhone Simulator测试,修改后**支持真机测试**(目前模拟器的兼容没有做)
2. 支持真机收集**系统日志(Systemlog)**,利用[deviceconsole][dc]实现
3. 支持真机收集**崩溃日志(Crashlog)**,利用[libimobiledevice][lidvc]**idevicecrashreport**实现
4. 解决在iPhone5及以上分辨率的设备上测试报告截图手势坐标绘制错误的问题
5. 解决判定crash出现失败的情况。
6. 测试报告中添加设备信息及应用信息(Summary下)
7. 使用最新版的[UIAutoMonkey][uiatmonkey],加入`UI Holes``Application Not Repsonding ("ANR")`的处理,添加[custom.js][custom]作为入口脚本.
8. 加入[tuneup][tp]依赖
9. 修改**UIAutoMonkey.js**中截图策略,为每个Event Action进行截图
10. 修改**CrashMonkey**中测试报告显示截图策略,增加至最近的50张
11. 解决大家一直所诟病的iOS App执行Monkey测试过程当中跳出程序后,导致脚本block,App无法自动返回的问题,解决方案:利用一个线程去监听instruments执行过程当中的日志,每隔20s进行前后比对,如果日志没有更新则说明App hanged,利用**idevicedebug**恢复App至前台。
###简要说明:
1. 支持**真机测试、模拟器测试**
2. 支持收集**系统日志(Systemlog)****崩溃日志(Crashlog)*****instrument行为日志***
3. 支持测试报告截图,绘制行为轨迹
4. 支持测试设备信息收集
5. 使用最新版的[UIAutoMonkey][uiatmonkey],加入`UI Holes``Application Not Repsonding ("ANR")`的处理,添加[custom.js][custom]作为入口脚本.
6. 加入[tuneup][tp]依赖
7. 修改**UIAutoMonkey.js**中截图策略,为每个Event Action进行截图
8. 支持测试执行过程中App进入后台,自动恢复(测试不会block)
[lidvc]:https://github.com/libimobiledevice/libimobiledevice
[dc]:https://github.com/rpetrich/deviceconsole
[uiatmonkey]: https://github.com/jonathanpenn/ui-auto-monkey/blob/master/UIAutoMonkey.js
[custom]:https://github.com/vigossjjj/CrashMonkey4IOS/blob/master/lib/ui-auto-monkey/custom.js
[tp]:https://github.com/vigossjjj/CrashMonkey4IOS/tree/master/lib/ui-auto-monkey/tuneup
[troubleshooting]:https://github.com/vigossjjj/CrashMonkey4IOS/tree/master/Troubleshooting.md

###依赖及安装:
###环境及依赖安装:
###### 系统要求
1. 安装Ruby运行环境,建议不要使用OS X自带版本,可自行使用RVM安装最新版的Ruby。建议使用淘宝镜像安装,速度比较快,`$ sed -i -e 's/ftp\.ruby-lang\.org\/pub\/ruby/ruby\.taobao\.org\/mirrors\/ruby/g' ~/.rvm/config/db`
2. 确保gem可用,也建议使用淘宝镜像 `gem sources --remove https://rubygems.org/;gem sources -a http://ruby.taobao.org/;gem sources -l`
3. 安装**Homebrew** `ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"`
4. 建议Xcode 6.x +

###### 依赖安装
1. `brew install -HEAD ideviceinstaller`
2. `brew install libimobiledevice`
3. `brew install imagemagick`
4. `gem install smart_monkey`

###使用说明:
1. 运行`sh reset.sh`安装相关依赖
2. 执行前需要先配置[custom.js][custom]相关参数
3. 执行命令`/CrashMonkey4IOS/bin/smart_monkey -a ${App_BunnelID} -w ${iPhone_UDID} -n 1`
1. 执行前需要先配置[custom.js][custom]相关参数
2. 执行命令`smart_monkey -a ${App_BunnelID} -w ${iPhone_UDID}`

###参数说明:
```
$ smart_monkey -h
Usage: smart_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)
-a app_name Bundle ID of the desired target on device(Required)
-w device Target Device UDID(Required)
-n run_count How many times monkeys run(default: 1)
-d result_dir Where to output result(default: ./smart_monkey_result)
-t time_limit_sec Time limit of running(default: 100 sec)
-t time_limit_sec Time limit of running
-s dsym_file Use .dSYM file to symbolicating crash logs
-c custom_path Configuration custom.js Path
-e extend_javascript_path Extend Uiautomation Javascript for such Login scripts
Expand All @@ -50,12 +55,11 @@ Usage: smart_monkey [options]
--list-app Show List of Installed Apps in iPhone/iPhone Simulator
--list-devices Show List of Devices
--reset-iPhone-Simulator Reset iPhone Simulator
--version print crash monkey version
--version print smart monkey version
```

###TODO List:
1. 适配iPhone Simulator
2. 修改配置脚本及文档。
2. 配置文件参数优化

###Troubleshooting:
安装和执行测试遇到的问题解决方案请参看:[Troubleshooting.md][troubleshooting]
Expand Down

0 comments on commit 0c8bd92

Please sign in to comment.