本文是基於集成mrx102開源stf和webdriverAgent,所遇到的坑做一些總結.
項目地址:
https://github.com/mrx1203/stf.git
https://github.com/mrx1203/WebDriverAgent.gitnode
安裝libimobiledevice等依賴工具。ios
brew install usbmuxd brew link usbmuxd brew install libimobiledevice brew install ideviceinstaller brew install carthage brew install socat
安裝stf依賴:brew install graphicsmagick zeromq protobuf yasm pkg-config
git
clone代碼WebDriverAgent,假設代碼存放路徑爲/Users/test/Desktop/WebDriverAgent/,這個路徑在啓動ios-provider是經過--wda-path傳入。配置好WebDriverAgent,在項目根目錄運行github
./Scripts/bootstrap.sh
由於ios-provider須要使用xcodebuild等mac下的命令行工具,而docker容器中並無提供這類工具,因此不能用docker來部署ios-provider,只能經過源碼方式部署。部署步驟以下:
(1)拉取源代碼git clone https://github.com/mrx1203/stf.git
(2)切換到stf目錄下,安裝依賴庫npm install;npm install --save request;npm install --save request-promise
這裏有個坑就是:node 版本要用8.9.3版本的,要否則有問題,用nvm安裝8.9.3版本的node
(3)啓動stf,cd到stf項目的bin目錄下,執行下面命令,ip爲本機 ipweb
./stf local --public-ip 172.10.24.85 --wda-path /Users/so/Desktop/stf_autorunJs/WebDriverAgent --wda-port 8100