Transferred from: http://www.cnblogs.com/baconLiu/p/6861431.html
Tips: Webdriveragent is a newly added module for Appium1.6.3 later, to allow Appium to communicate with the iphone (Xcuitest-based) device. However, this module is a standalone project that must be compiled and installed before it is used. The following describes the compilation and packaging of Webdriveragent in Appium.
Appium-xcuitest-driver Dependencies (two compilations, installation methods)
Method One: Based on the Apple ID, compile, install the project
1. Enter the Webdriveragent installation directory. Run Bootstrap
cd /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent (如果WebDriverAgent 所在路径和此不同,请自行查找)mkdir -p Resources/WebDriverAgent.bundlesh ./Scripts/bootstrap.sh
In the run SH./scripts/bootstrap.sh It is likely that the network connection failed because of our greater China LAN. The way is to go to the App store to download a VPN agent software, I scored the most and free, and indeed very useful. I'm not going to say the name of the software.
Run sh again./scripts/bootstrap.sh no error will be OK.
2. Open webdriveragent with Xcode, and compile
To enter the Webdriveragent folder, use the following methods
Double-click Webdriveragent.xcodeproj to open this project, which is interested in Facebook open source to study https://github.com/facebook/WebDriverAgent/apple. Our goal here is to change some configuration so that he can compile successfully, you have to have an ID account before compiling, and log in to your Xcode account. Of course, it would be better if you had a developer account.
compiling Webdriveragentlib
compiling Webdriveragentrunner
3. Set up the service webdriveragent, close Xcode, and go to the Webdriveragent folder
cd /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgentxcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination ‘id=真机的udid‘ test
tips:这种方式安装好的iPhone端wda需要在iPhone设备的“管理”界面进行信任。并且,在使用的时候需要连接外网,不支持内网运行。
Method Two: Compile and install based on the developer certificate.
1. Enter the Webdriveragent installation directory. Run Bootstrap
cd /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent (如果WebDriverAgent 所在路径和此不同,请自行查找)mkdir -p Resources/WebDriverAgent.bundlesh ./Scripts/bootstrap.sh
In the run SH./scripts/bootstrap.sh It is likely that the network connection failed because of our greater China LAN. The way is to go to the App store to download a VPN agent software, I scored the most and free, and indeed very useful. I'm not going to say the name of the software.
Run sh again./scripts/bootstrap.sh no error will be OK.
2. Open webdriveragent with Xcode
Double-click Webdriveragent.xcodeproj to open the project.
compiling Webdriveragentlib
Do not select Automatially, add developer account in team
compiling Webdriveragentrunner
Import the certificate without checking automatically. The same is true of several other modules.
3. Set up the service webdriveragent, close Xcode, and go to the Webdriveragent folder
cd /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgentxcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination ‘id=真机的udid‘ test
tips:这种方式在安装完成后,运行wda是不需要外网的,在内网环境下同样可以运行。
Appium1.6.x-based webdriveragent compilation, installation