自从我的设备和xCode更新到iOS 10和Xcode 8后,我无法在真实设备上成功设置Appium测试。但是,我在模拟器上工作正常。以下是我的功能设置:
DesiredCapabilities cap = new DesiredCapabilities();
File f = new File("/Path/App.ipa");
cap.setCapability(MobileCapabilityType.APPIUM_VERSION, "1.6.0");
cap.setCapability(MobileCapabilityType.PLATFORM_NAME, "iOS");
cap.setCapability(MobileCapabilityType.PLATFORM_VERSION, "10.1.1");
cap.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone 6 (Model MG472B/A)");
cap.setCapability(MobileCapabilityType.UDID, "20a548dc87a87ecddf7ab3975a4b5f3395ac1a0");
cap.setCapability(MobileCapabilityType.APP,f.getAbsolutePath());
cap.setCapability("bundleId", "co.uk.xx");
cap.setCapability(MobileCapabilityType.AUTOMATION_NAME,"XCUITest");
cap.setCapability("noReset", "true");
try {
driver = new IOSDriver<WebElement>(new URL("http://127.0.0.1:4723/wd/hub"), cap);
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
我遇到以下错误:
'处理命令时发生未知的服务器端错误。原始错误:未知设备或模拟器UDID:'xx'。
Appium通过链接https://gist.github.com/dodigital/ee5944f31b34749edf3d1c57146594e7
登录答案 0 :(得分:1)
Available devices: 20a548dc87a87ecddf7ab3975a4b5f3395ac1a0b [XCUITest] Error: Unknown device or simulator UDID: '20a548dc87a87ecddf7ab3975a4b5f3395ac1a0' .
这是你得到的错误udid的错误。你到底想念'b'
答案 1 :(得分:0)
我终于能够通过以下步骤解决问题并在真实设备上运行:
任何有问题的人,请随时在这篇文章下写。我花了两天时间艰难地解决问题。