一.下載安裝
1.下載
git clone https://github.com/facebook/WebDriverAgent.git Localpath
localPath為本地路徑
2.安裝
./Scripts/bootstrap.sh
二.開啟服務(wù)
xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'platform=iOS Simulator,name=iPhone 6' ?test
ps:真機(jī)使用 -destination 'id='
真機(jī)會報錯沒有簽名的錯誤
解決方法:
運(yùn)行到最后會發(fā)現(xiàn)
原因是我們手機(jī)并并沒有信任這個apple id的開發(fā)者废菱,到設(shè)置-通用-設(shè)備管理(描述文件) 信任你的apple id就可以了技矮。再次運(yùn)行上述命令,看到如下圖殊轴,就成功了
得到DEVICE_URL
ServerURLHere->http://[SOME_IP]:8100<-ServerURLHere
三.進(jìn)行通信
例如:curl -X GET $JSON_HEADER $DEVICE_URL/status
更多查看 https://github.com/facebook/WebDriverAgent/wiki/Queries 或查看源碼