我试图使用appium
在真实设备(iPhone 4)上启动safari浏览器。但它给出了以下错误。
无法将[/var/folders/7_/fz8kyhyn2g97s1m9zylk50xc0000gq/T/11545-10782-1dp1wfm/submodules/SafariLauncher/build/Release-iphoneos/SafariLauncher.app]安装到ID为[fdaxxx76]的设备上。
错误[错误:命令失败:/ bin / sh -c /Applications/Appium.app/Contents/Resources/node_modules/appium/build/fruitstrap/fruitstrap install --id fda51be7184f865f02de4f4c6cb8fff760964e76 --bundle" / var / folders / 7_ / fz8kyhyn2g97s1m9zylk50xc0000gq / T / 11545-10782-1dp1wfm /子模块/ SafariLauncher /建立/释放-的iPhoneOS / SafariLauncher.app"
以下是我的示例代码:
DesiredCapabilities cap = new DesiredCapabilities();
private static WebDriver driver;
@BeforeTest
public void prep() throws MalformedURLException {
System.out.println("Script started");
cap.setCapability("platformName", "iOS");
cap.setCapability("platformVersion", "8.3");
cap.setCapability("deviceName", "iPhone4");
cap.setCapability("udid", "fda51be7184f865f02de4f4c6cb8fff760964e76");
cap.setCapability("browserName", "Safari");
driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), cap);
}
@Test
public void googleTest() {
System.out.println("main method");
driver.get("http://google.com");
}