转载自 https://testerhome.com/topics/7220 部分内容有改动
下载
- 首先下载WebDriverAgent
git clone https://github.com/facebook/WebDriverAgent.git
brew install Carthage
如果Homebrew访问慢的话 参考更换Homebrew的更新源
- 执行完成后,直接双击打开WebDriverAgent.xcodeproj这个文件。
设置证书
因为安装到真机上都是需要证书签名的。需要先在xcode中设置账号。

画圈的地方,从左向右依次点击。最后Team那一栏,选择个人证书也可以,接着在TARGETS里面选中WebDriverAgentRunner,用同样的方法设置好证书

运行与测试
菜单栏选择目标设备

Scheme选择WebDriverAgentRunner

最后运行 Product -> Test
一切正常的话,手机上会出现一个无图标的WebDriverAgent应用,启动之后,马上又返回到桌面。
端口转发
iproxy 8100 8100
验证
打开浏览器 输入 http://localhost:8100/status 显示一串JSON表示没问题
网友评论