码迷,mamicode.com
首页 > 移动开发 > 详细

基于Appium1.6.X的WebDriverAgent编译、安装

时间:2017-09-16 17:12:02      阅读:294      评论:0      收藏:0      [点我收藏+]

标签:一个   dep   通信   /usr   网络连接   ges   lib   报错   get   

转自:http://www.cnblogs.com/baconLiu/p/6861431.html

 

tips:WebDriverAgent是Appium1.6.3以后版本新添加的模块,为了让appium与iPhone(基于xcuitest)设备进行通信而添加的。但是,这个模块在是一个独立的项目,在使用前必须编译、安装。下面介绍Appium中的WebDriverAgent的编译和打包。

 

appium-xcuitest-driver依赖(两种编译,安装方式)

方法一:基于Apple ID,编译,安装项目

1. 进入WebDriverAgent安装目录。运行bootstrap

cd  /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent (如果WebDriverAgent 所在路径和此不同,请自行查找)
mkdir -p Resources/WebDriverAgent.bundle
sh ./Scripts/bootstrap.sh

在运行sh ./Scripts/bootstrap.sh很可能会有因为咱们大中华局域网而网络连接失败。方法就是去App store下载了一个VPN代理软件,我下了一个评分最多且免费的,的确很好用。我就不说软件名称了。
再次运行sh ./Scripts/bootstrap.sh 无报错就OK了

 

2. 用Xcode打开WebDriverAgent,并且编译
       进入WebDriverAgent 文件夹,可用如下方法

 


       双击WebDriverAgent.xcodeproj打开此项目,这个项目由facebook开源 有兴趣的话可以研究https://github.com/facebook/WebDriverAgent/apple。在这里我们的目的就是更改一些配置,让他能够编译成功,首先编译之前你得有 ID账号,并且登录你的Xcode账户。当然如果有开发者账号那么会更好。
       编译WebDriverAgentLib

 


       编译WebDriverAgentRunner

 
 

3. 建立服务WebDriverAgent ,关闭Xcode,进入WebDriverAgent 文件夹

  

cd  /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent
xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination ‘id=真机的udid‘ test

tips:这种方式安装好的iPhone端wda需要在iPhone设备的“管理”界面进行信任。并且,在使用的时候需要连接外网,不支持内网运行。

 

方法二:基于开发者证书编译、安装。
  

1. 进入WebDriverAgent安装目录。运行bootstrap

cd  /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent (如果WebDriverAgent 所在路径和此不同,请自行查找)
mkdir -p Resources/WebDriverAgent.bundle
sh ./Scripts/bootstrap.sh

在运行sh ./Scripts/bootstrap.sh很可能会有因为咱们大中华局域网而网络连接失败。方法就是去App store下载了一个VPN代理软件,我下了一个评分最多且免费的,的确很好用。我就不说软件名称了。
再次运行sh ./Scripts/bootstrap.sh 无报错就OK了

2. 用Xcode打开WebDriverAgent

       双击WebDriverAgent.xcodeproj打开此项目。
       编译WebDriverAgentLib

   不选中Automatially,在Team里面添加开发者账号

 技术分享

 

 

  编译WebDriverAgentRunner

 不选中Automatically,导入证书。其他的几个模块也是如此。

技术分享 

 

3. 建立服务WebDriverAgent ,关闭Xcode,进入WebDriverAgent 文件夹

  

cd  /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent
xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination ‘id=真机的udid‘ test

tips:这种方式在安装完成后,运行wda是不需要外网的,在内网环境下同样可以运行。

基于Appium1.6.X的WebDriverAgent编译、安装

标签:一个   dep   通信   /usr   网络连接   ges   lib   报错   get   

原文地址:http://www.cnblogs.com/digod/p/7531532.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!