Sagar Satre
Sagar Satre

Reputation: 11

Safari browser not launch on real device using appium

I was trying to launch safari browser on real device(iPhone 4) using appium. but it is giving following error.

Unable to install [/var/folders/7_/fz8kyhyn2g97s1m9zylk50xc0000gq/T/11545-10782-1dp1wfm/submodules/SafariLauncher/build/Release-iphoneos/SafariLauncher.app] to device with id [fdaxxx76].
Error [Error: Command failed: /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/submodules/SafariLauncher/build/Release-iphoneos/SafariLauncher.app"

Below is my sample code:

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");
}

Upvotes: 1

Views: 439

Answers (1)

Liam Ferris
Liam Ferris

Reputation: 1846

You need to create a provisioning profile to deploy it to a real device.

Follow instructions here.

Hope this helps,

Liam

Upvotes: 1

Related Questions