iOS 真機、模擬器除錯 CrashMonkey4IOS
阿新 • • 發佈:2019-02-13
簡要
CrashMonkey4IOS 能夠執行在你的真機和模擬器上,幫助收集crash
報告,並且附有截圖,一目瞭然,
安裝 (Monkey 支援 brew
安裝,沒有安裝brew
的自行去安裝)
// 以下是 CrashMonkey4IOS 執行依賴的必要安裝
brew install libimobiledevice
brew install -HEAD ideviceinstaller
brew install imagemagick
// 安裝 CrashMonkey4IOS
gem install smart_monkey
如果最後一步安裝提示You don't have write permissions for the /Library/Ruby/Gems/
請移步
除錯
執行以下命令來除錯你的程式
smart_monkey -a ${App_BunnelID} -w ${iPhone_UDID}
引數列表
- -a: 指向被測程式的BundleID(不可預設)。e.g.-a com.mytest.app
-w: 指向測試裝置的UDID,可以通過$instruments -s devices進行裝置id的檢視,若預設則預設指向第一臺裝置(模擬器或真機)。e.g.-w 26701a3a5bc17038ca0465186407b912375b35a7 可以使用以下命令檢視當前連線的所有裝置 UDID
instruments -s devices
- -n: monkey測試的執行次數,預設為1次。e.g.-n 3
- -d: 測試報告地址,預設為當前目錄下的smart_monkey_result資料夾下。e.g.-d ~/my-monkey-test-result
- -t: 執行時間,單位為秒。e.g.-t 60
-s: 指向被測app的.dSYM檔案,若出現crash,解析crash為明文。e.g.-s testapp.dSYM
檢視報告
如果有指定報告目錄,在指定目錄下,沒有指定,則在當前目錄下,開啟 index.html 檢視。