Appium-Using ios-webkit-debug-proxy(使用iOS-webkit调试代理)


For accessing web views on real iOS device appium uses ios_webkit_debug_proxy.

为访问web view在实体iOS device上
Appium使用ios_webkit_debug_proxy.
Installation
Using Homebrew

To install the latest tagged version of the ios-webkit-debug-proxy using Homebrew, run the following commands in the terminal:

要安装最新版本使用自制的ios-webkit-debug-proxy,
在终端中运行命令:

shell # The first command is only required if you don't have brew installed. $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" $ brew update $ brew install ios-webkit-debug-proxy

Building ios-webkit-debug-proxy from source

Open the command terminal on your linux machine. You can find instructions on how to open the terminal via your favorite search engine.

打开命令终端在你的Linux机器上.
在你的偏好的搜索引擎上你可以找到如何打开终端的说明.
$ cd  ~
$ sudo apt-get install autoconf automake libusb-dev libusb-1.0-0-dev libplist-dev libplist++-dev usbmuxd libtool libimobiledevice-dev
$ git clone https://github.com/google/ios-webkit-debug-proxy.git
$ cd ios-webkit-debug-proxy
$ ./autogen.sh
$ make
$ sudo make install
Running ios-webkit-debug-proxy

Once installed you can start the proxy with the following command:

安装后你可以启动代理用以下命令
# Change the udid to be the udid of the attached device and make sure to set the port to 27753
# as that is the port the remote-debugger uses. You can learn how to retrieve the UDID from
# Apple's developer resources.
> `ios_webkit_debug_proxy -c 0e4b2f612b65e98c1d07d22ee08678130d345429:27753 -d`

You can also set the desired capability called startIWDP to true (see the desired capabilities docs). This will run the above command as a subprocess from within Appium and will set the udid, so you don’t have to run ios_webkit_debug_proxy yourself anymore. It monitors the proxy for crashes and relaunches when needed.

你也可以设置期望功能名为 `startIWDP`设置为'true'
(请参阅desired capabilities文档).
这将运行上述命令作为Appium得子进程,将设置uuid,
所以你不必再自己运行 ios_webkit_debug_proxy.
它监视代理的崩溃并再需要时重新启动.
// example desired capabilities
{
  "browserName": "Safari",
  "platformName": "iOS",
  "deviceName": "iPhone 7",
  "automationName": "XCUITest",
  "startIWDP": true,
  "udid": "auto"
}

You may also use ios-webkit-debug-proxy-launcher, a small script included with the Appium codebase, to launch the proxy. It monitors the proxy log for errors, and relaunch the proxy where needed. This is also optional and may help with recent devices:

你也可以用'ios-webkit-debug-proxy-launcher',
Appium codebase中的一个小脚本,来启动代理.
它监视代理日志中的错误,
并在需要的时候重启代理.
这是也可以选择的并且可能帮助使用最新的设备.
# change the udid
# note, this is run from an Appium repository
> ./bin/ios-webkit-debug-proxy-launcher.js -c 0e4b2f612b65e98c1d07d22ee08678130d345429:27753 -d

NOTE: the proxy requires the “web inspector” to be turned on to allow a connection to be established. Turn it on by going to settings > safari > advanced.

注意:代理需要'web inspector'是打开的在允许连接的.
通过'settings > safari > advanced'打开它.
Specifying non-default port

Appium expects ios-webkit-debug-proxy to be running on port 27753. If, for whatever reason, this needs to be changed, the webkitDebugProxyPortdesired capability can be set with the port on which it the proxy is running.

Appium要求ios-webkit-debug-proxy去运行端口27753上.
如果,不管什么原因,需要更改,
webkitDebugProxyPort所需功能可以设置代理运行的端口.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Aniona

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值