一、環境搭建准備
- 安裝homebrew:https://www.jianshu.com/p/2af8d44d7230
- 安裝libimobiledevice:見上面鏈接
- 安裝ideviceinstaller:見上面鏈接
- 安裝crathage:brew install carthage
- 安裝node:brew install node
- 安裝python3.7
- 安裝xcode
- 安裝xcode command line tools:https://www.jianshu.com/p/729fb02a506c
- xcode->perferences->locations->選擇Command line tools
二、安裝wda並運行WebDriverAgentRunner
- git clone https://github.com/appium/WebDriverAgent.git (https://github.com/appium/WebDriverAgent)
- cd WebDriverAgent,執行./Scripts/bootstrap.sh
- 打開WebDriverAgent.xcodeproj
- Scheme選擇WebDriverAgentRunner,Product->Test
- 當看到控制台輸出:
ServerURLHere->http://172.25.67.84:8100<-ServerURLHere,表示wda安裝成功
-
在終端執行命令,把當前連接設備的8100端口(SSH端口)映射到電腦的8100端口
iproxy 8100 8100
在瀏覽器中輸入http://172.25.67.84:8100/status,查看效果圖,說明配置成功
三、wda安裝到真機
1.選中WebDriverAgentLib修改Build Settings-->Product Bundle Identifier修改com.facebook.WebDriverAgentLib為唯一的bundle id,見圖
2.選中WebDriverAgentRunner修改Build Settings-->Product Bundle Identifier修改com.facebook.WebDriverAgentLib為唯一的bundle id,同上
3.修改WebDriverAgentLib和WebDriverAgentRunner的Signing,見圖