IOS自动化框架-WebDriverAgent

一.下载安装

1.下载

git clone https://github.com/facebook/WebDriverAgent.git Localpath

localPath为本地路径

2.安装

./Scripts/bootstrap.sh

二.开启服务

xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'platform=iOS Simulator,name=iPhone 6'  test

ps:真机使用 -destination 'id='

真机会报错没有签名的错误

解决方法:

IOS自动化框架-WebDriverAgent_第1张图片
IOS自动化框架-WebDriverAgent_第2张图片
IOS自动化框架-WebDriverAgent_第3张图片

运行到最后会发现

原因是我们手机并并没有信任这个apple id的开发者,到设置-通用-设备管理(描述文件) 信任你的apple id就可以了。再次运行上述命令,看到如下图,就成功了

得到DEVICE_URL

ServerURLHere->http://[SOME_IP]:8100<-ServerURLHere

三.进行通信

例如:curl -X GET $JSON_HEADER $DEVICE_URL/status

更多查看 https://github.com/facebook/WebDriverAgent/wiki/Queries 或查看源码

更多信息查看 https://github.com/facebook/WebDriverAgent/wiki/Starting-WebDriverAgent

你可能感兴趣的:(IOS自动化框架-WebDriverAgent)