Monkey for iOS

來源:互聯網
上載者:User

標籤:

CrashMonkey4IOS介紹

  1. 支援真機測試、模擬器測試
  2. 支援收集系統日誌(Systemlog)、崩潰日誌(Crashlog)、instrument行為日誌
  3. 支援測試報告,繪製行為軌跡
  4. 支援測試裝置資訊收集
  5. 使用最新版的UIAutoMonkey,加入UI HolesApplication Not Repsonding ("ANR")的處理,添加custom.js作為入口指令碼.
  6. 加入tuneup依賴
  7. 修改UIAutoMonkey.js中策略,為每個Event Action進行
  8. 支援測試執行過程中App進入後台,自動回復(測試不會block)

 

 

一、環境安裝

1.  安裝Homebrew

1 ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

2. 安裝依賴

1 brew install libimobiledevice2 brew install -HEAD ideviceinstaller3 brew install imagemagick4 sudo gem install smart_monkey  #終端下直接以smart_monkey -a app_name -w device的形式跑

 

 

二、在iOS模擬器上安裝APP

目前CrashMonkey4IOS沒有自動啟動模擬器的功能,因此需先確認被測裝置(包括模擬器)已經啟動完畢並停留在案頭,如處在鎖定畫面請先解鎖

1. 通過命令列啟動模擬器

1 xcrun instruments -w ‘iPhone 6 Plus‘

2. 在模擬器中安裝APP

1 xcrun simctl install booted /Users/Kz/Documents/Join10.app

( xcrun 這個命令實際還有很多更高深的玩法,通過xcrun --help可以自己學習和領悟 )

 

三、參數說明

 

 1 -a: 指向被測程式的BundleID(不可預設)。e.g.-a com.mytest.app 2 -w: 指向測試裝置的UDID,可以通過$instruments -s devices查看裝置id,若預設則預設指向第一台裝置(模擬器或真機) 如:-w 26701a3a5bc17038ca0465186407b912375b35a7 3 -n: monkey測試的執行次數,預設為1次。e.g.-n 3 4 -d: 測試報告地址,預設為目前的目錄下的smart_monkey_result檔案夾下。如:-d ~/my-monkey-test-result 5 -t: 執行時間,單位為秒。如:-t 60 6 -s: 指向被測app的.dSYM檔案,若出現crash,解析crash為明文。如:-s testapp.dSYM 7 -c: 自訂的配置集路徑,參數必須為目錄,目錄下必須包含custom.js,若使用handler,目錄下需存在名為handler的檔案夾,用於存放相關檔案。如:-c /my/path/custom_cfg 8  9 如果使用custom_cfg必須遵守如下目錄結構:10 11 custom_cfg12     ├── custom.js13     └── handler14         ├── buttonHandler.js15         └── wbScrollViewButtonHandler.js16 --event-number: 定義Monkey測試的總事件數目,預設為50。如:--event-number 10017 --compress-result: 對測試過程中截取的圖片進行壓縮,以節省空間的開銷。如:--compress-result 50%18 --detail-count: 定義報告詳情中記錄的事件總數,預設為50,即在報告當中展示最近的50次隨機事件,且進行操作示意繪製。如:--detail-count 10019 --show-config: 列印當前的配置資訊,即custom.js。如:--show-config20 --drop-useless-img: 刪除除展示在報告當中的其餘,以節省空間的開銷,如,一輪Monkey測試共產出100張,參數--detail-count設定為20,那麼使用--drop-useless-img會刪除其餘80張。如:--drop-useless-img21 --list-app: 列印當前串連的真機及模擬器中所安裝的app。如:--list-app22 --list-devices: 列印當前所有可用裝置。如:--list-devices23 --reset-ios-sim: 重啟模擬器。如:--reset-ios-sim24 --version: 列印smart_monkey的版本號碼。如:--version

 

Monkey for iOS

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.