gpt4 book ai didi

ios - iPhone真机自动化环境搭建

转载 作者:可可西里 更新时间:2023-11-01 04:40:56 24 4
gpt4 key购买 nike

我正在尝试使用 Java 和 Selenium 编写脚本。使用 Appium 工具进行自动化。我在模拟器上完成了网络应用程序的测试。我想知道是否可以通过 Wifi 将真实的 iPhone 设备连接到 MAC 来运行测试脚本。如果是,xcode 是否能够检测到该设备?如果没有,是否有任何软件可以帮助我实现这一目标。
我知道有使用 USB 连接的选项,但我正在处理远程 MAC 机器。

最佳答案

现在,如果我正确理解了您的问题 - 您想要在真实设备上运行测试而无需物理连接到 MAC。

    **Answers:**

1. There is no way, you can run test on Real Device without physically connecting it to Mac with an Xcode.
2. Xcode can't detect any iPhone via wifi.
3. There is one way to run test on iPhone without physical connection, if you want to run tests on mobile website that is Safari:
A. **ONE TIME SETUP** You need to install iWeb Driver (app) in iPhone once via Xcode. This is a deprecated way though. If you want this, I'll upload the iWeb Driver source code on github, you can download and install further.
B. Now before running test, you need to launch the iWeb Driver (app) manually on device, once you run this, it will flash an a URL on app.
C. Use this url in Remote Webdriver like:

DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability(CapabilityType.PLATFORM, DesiredCapabilities.iphone());

WebDriver iphoneDriver = new RemoteWebDriver(new URL(iphoneIp), cap);
and then use this driver just like other and run your tests.

关于ios - iPhone真机自动化环境搭建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41458678/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com