question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

In Appium 1.5.3, unable to launch Safari in iOS

See original GitHub issue

The problem

I am trying to automate mobile web application in iOS. For that I need to launch safari.

Environment

  • Appium version (or git revision) that exhibits the issue: 1.5.3
  • Desktop OS/version used to run Appium: osx 10.11.5
  • Node.js version (unless using Appium.app|exe): 4.5.0
  • Mobile platform/version under test:
  • Real device or emulator/simulator: simulator
  • Appium CLI or Appium.app|exe: node appium

Details

[iOS] Error: Command failed: /bin/sh -c ideviceinstaller -u D2895B69-8825-4581-9ED1-22ACB4BC3AAC -l

at ChildProcess.exithandler (child_process.js:213:12)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:829:16)
at Socket.<anonymous> (internal/child_process.js:319:11)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at Pipe._onclose (net.js:486:12)

{ [Error: Command failed: /bin/sh -c ideviceinstaller -u D2895B69-8825-4581-9ED1-22ACB4BC3AAC -l ] cause: { [Error: Command failed: /bin/sh -c ideviceinstaller -u D2895B69-8825-4581-9ED1-22ACB4BC3AAC -l ] killed: false, code: 2, signal: null, cmd: '/bin/sh -c ideviceinstaller -u D2895B69-8825-4581-9ED1-22ACB4BC3AAC -l ’ }, isOperational: true, killed: false, code: 2, signal: null, cmd: '/bin/sh -c ideviceinstaller -u D2895B69-8825-4581-9ED1-22ACB4BC3AAC -l ’ } [iOS] Bad app: ‘/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/build/SafariLauncher/SafariLauncher.app’. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name. [MJSONWP] Encountered internal error running command: Error: Bad app: /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/build/SafariLauncher/SafariLauncher.app. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name.

Seems there are 2 errors. 1st is: Command failed: /bin/sh -c ideviceinstaller -u D2895B69-8825-4581-9ED1-22ACB4BC3AAC -l 2nd is: Bad app: /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/build/SafariLauncher/SafariLauncher.app There is not SafariLauncher.app in the path. Even if I build SafariLauncher myself and put it to the path, still no work.

Link to Appium logs

Create a gist which is a paste of your full Appium logs, and link them here. Do not paste your full Appium logs here, as it will make this issue very long and hard to read! If you are reporting a bug, always include Appium logs!

Code To Reproduce Issue [ Good To Have ]

I use java, and the test code: public class DebugIOSTest { protected Logger logger = LoggerFactory.getLogger(getClass());

protected MobileDriver driver;

@Test
public void test() throws MalformedURLException {
    DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
    desiredCapabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone Simulator");

// desiredCapabilities.setCapability(“bundleId”, “com.apple.mobilesafari”); // desiredCapabilities.setCapability(“udid”, “81efb4eadca74ab261864f3e4252cb10fe4bc8df”); desiredCapabilities.setCapability(“udid”, “D2895B69-8825-4581-9ED1-22ACB4BC3AAC”);

    desiredCapabilities.setCapability(MobileCapabilityType.BROWSER_NAME, MobileBrowserType.SAFARI);
    desiredCapabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "9.3");
    URL url = new URL("http://127.0.0.1:4723/wd/hub");
    this.driver = new IOSDriver<IOSElement>(url, desiredCapabilities);

    driver.get("http://www.baidu.com");
    System.out.println(driver.getPageSource());
}

@AfterClass(alwaysRun = true)
public void afterClass() {
    driver.quit();
}

}

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
imurchiecommented, Sep 27, 2016

Do not specify a udid if this is a simulator test. The system is trying to install on a real device.

On Tuesday, September 27, 2016, ReinhardXu2007 notifications@github.com wrote:

The problem

I am trying to automate mobile web application in iOS. For that I need to launch safari. Environment

  • Appium version (or git revision) that exhibits the issue: 1.5.3
  • Desktop OS/version used to run Appium: osx 10.11.5
  • Node.js version (unless using Appium.app|exe): 4.5.0
  • Mobile platform/version under test:
  • Real device or emulator/simulator: simulator
  • Appium CLI or Appium.app|exe: node appium

Details

[iOS] Error: Command failed: /bin/sh -c ideviceinstaller -u D2895B69-8825-4581-9ED1-22ACB4BC3AAC -l

at ChildProcess.exithandler (child_process.js:213:12) at emitTwo (events.js:87:13) at ChildProcess.emit (events.js:172:7) at maybeClose (internal/child_process.js:829:16) at Socket.<anonymous> (internal/child_process.js:319:11) at emitOne (events.js:77:13) at Socket.emit (events.js:169:7) at Pipe._onclose (net.js:486:12)

{ [Error: Command failed: /bin/sh -c ideviceinstaller -u D2895B69-8825-4581-9ED1-22ACB4BC3AAC -l ] cause: { [Error: Command failed: /bin/sh -c ideviceinstaller -u D2895B69-8825-4581-9ED1-22ACB4BC3AAC -l ] killed: false, code: 2, signal: null, cmd: '/bin/sh -c ideviceinstaller -u D2895B69-8825-4581-9ED1-22ACB4BC3AAC -l ’ }, isOperational: true, killed: false, code: 2, signal: null, cmd: '/bin/sh -c ideviceinstaller -u D2895B69-8825-4581-9ED1-22ACB4BC3AAC -l ’ } [iOS] Bad app: ‘/Applications/Appium.app/Contents/Resources/node_ modules/appium/node_modules/appium-ios-driver/build/ SafariLauncher/SafariLauncher.app’. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name. [MJSONWP] Encountered internal error running command: Error: Bad app: /Applications/Appium.app/Contents/Resources/node_ modules/appium/node_modules/appium-ios-driver/build/ SafariLauncher/SafariLauncher.app. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name.

Seems there are 2 errors. 1st is: Command failed: /bin/sh -c ideviceinstaller -u D2895B69-8825-4581-9ED1-22ACB4BC3AAC -l 2nd is: Bad app: /Applications/Appium.app/Contents/Resources/node_ modules/appium/node_modules/appium-ios-driver/build/ SafariLauncher/SafariLauncher.app There is not SafariLauncher.app in the path. Even if I build SafariLauncher myself and put it to the path, still no work. Link to Appium logs

Create a gist https://gist.github.com which is a paste of your full Appium logs, and link them here. Do not paste your full Appium logs here, as it will make this issue very long and hard to read! If you are reporting a bug, always include Appium logs! Code To Reproduce Issue [ Good To Have ]

I use java, and the test code: public class DebugIOSTest { protected Logger logger = LoggerFactory.getLogger(getClass());

protected MobileDriver driver;

@Test public void test() throws MalformedURLException { DesiredCapabilities desiredCapabilities = new DesiredCapabilities(); desiredCapabilities.setCapability(MobileCapabilityType.DEVICE_NAME, “iPhone Simulator”);

// desiredCapabilities.setCapability(“bundleId”, “com.apple.mobilesafari”); // desiredCapabilities.setCapability(“udid”, " 81efb4eadca74ab261864f3e4252cb10fe4bc8df"); desiredCapabilities.setCapability(“udid”, “D2895B69-8825-4581-9ED1- 22ACB4BC3AAC”);

desiredCapabilities.setCapability(MobileCapabilityType.BROWSER_NAME, MobileBrowserType.SAFARI);
desiredCapabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "9.3");
URL url = new URL("http://127.0.0.1:4723/wd/hub");
this.driver = new IOSDriver<IOSElement>(url, desiredCapabilities);

driver.get("http://www.baidu.com");
System.out.println(driver.getPageSource());

}

@AfterClass(alwaysRun = true) public void afterClass() { driver.quit(); }

}

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/appium/appium/issues/6900, or mute the thread https://github.com/notifications/unsubscribe-auth/ACfkUjTrCxtjMH7o0CRsUdfjIIKL2W1Bks5quRh0gaJpZM4KHqIt .

0reactions
lock[bot]commented, Apr 28, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to launch safari with appium 1.5.3 version - Issues/Bugs
Go to Apple Developer Page · Open the page [Certificate, Identifiers & Profile] · In the [Identifiers] click on [App IDs] --> Delete...
Read more >
In Appium 1.5.2, unable to launch Safari in iOS real devices
Just run the following command on terminal find . -name safari-launcher , and saw where safari laucher is stored. After you located the...
Read more >
Issues interacting with Safari Browser using Appium 1.5.3 - Issues ...
Hi All I am trying to launch a website and perform some automation tasks on the same but after the website launches in...
Read more >
Unable to launch safari in real device - Appium Discuss
2016-09-16 15:23:32:459 - [MJSONWP] Responding to client with driver.getStatus() result: {“build”:{“version”:“1.5.3”…
Read more >
Unable to launch safari on real device using appium
we are using following capabilities and xcode 7.3, appium 1.5.3, iphone 9.3.2, iphone 6, mac 10.11.4 capabilities.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found