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.

Issues with Simulators on Appium 1.4.13

See original GitHub issue

Issue: Cannot run tests with Simulators on Appium 1.4.13 - Simulator cannot Load and Crashes and Restarts in a Loop

Running simulator tests on Appium 1.4.13 fails, but Running real iPhone device tests works if installed appium via git clone, but not via npm, because safari launcher is not set up with npm correctly.

Environment: Mac El Capitan, Xcode 7.0.1, Appium 1.4.13

Note: My setup passes Appium-Doctor check

Steps to Reproduce:

  1. Install Appium 1a. Install from source -Type git clone https://github.com/appium/appium.git -Type in terminal to find code-signing identity: security find-identity -v -p codesigning -Type $ ./reset.sh --ios --real-safari --code-sign ‘code signing identity’ --profile ‘retrieved profile identity code’ 1b. Or Install from npm -npm install -g appium -npm install wd
  2. Open Appium GUI App 1.4.8 Select “Developer settings” and enable it. Select Use External NodeJS Binary to /usr/local/bin/node Select Use External Appium Package and link to appium folder path
  3. Set Force Device to iPhone 6 in Appium GUI App
  4. Open Xcode
  5. Start Appium Server via Appium GUI App if install from source Start Appium Server via terminal appium & if install from npm
  6. Launch iPhone 6 Simulator next or leave the script to launch it
  7. Run simulator script from Eclipse

Actual Results;

  1. Get this error “Failed to start an Appium session, err was: Error: Command failed: /bin/sh -c xcrun --sdk iphonesimulator --show-sdk-version”
  2. It would keep opening and closing the simulator in a loop.

Error Details: unknown20C9D0E03E3B:~ mac$ info: Welcome to Appium v1.4.13 (REV c75d8adcb66a75818a542fe1891a34260c21f76a) info: Appium REST http interface listener started on 0.0.0.0:4723 info: Console LogLevel: debug info: --> POST /wd/hub/session {“desiredCapabilities”:{“browserName”:“Safari”,“platformName”:“iOS”,“deviceName”:“iPhone 6”,“platformVersion”:“9.0”}} info: Client User-Agent string: Apache-HttpClient/4.4.1 (Java/1.8.0_60) info: [debug] Configuring Safari session info: [debug] We’re on iOS8+ so not copying mobile safari app info: [debug] Creating new appium session dd9efbb0-e4ac-496f-ab7c-33e016ba4ab0 info: [debug] Removing any remaining instruments sockets info: [debug] Cleaned up instruments socket /tmp/instruments_sock info: [debug] Setting Xcode version info: [debug] Xcode version set to 7.0.1 info: [debug] Setting iOS SDK Version error: Could not determine iOS SDK version info: [debug] Cleaning up appium session error: Failed to start an Appium session, err was: Error: Command failed: /bin/sh -c xcrun --sdk iphonesimulator --show-sdk-version

info: [debug] Error: Command failed: /bin/sh -c xcrun --sdk iphonesimulator --show-sdk-version

at ChildProcess.exithandler (child_process.js:751:12)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)

info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: Command failed: /bin/sh -c xcrun --sdk iphonesimulator --show-sdk-version\n)”,“cause”:{“killed”:true,“code”:null,“signal”:“SIGTERM”,“cmd”:“/bin/sh -c xcrun --sdk iphonesimulator --show-sdk-version”},“isOperational”:true,“killed”:true,“code”:null,“signal”:“SIGTERM”,“cmd”:“/bin/sh -c xcrun --sdk iphonesimulator --show-sdk-version”,“origValue”:“Command failed: /bin/sh -c xcrun --sdk iphonesimulator --show-sdk-version\n”},“sessionId”:null} info: <-- POST /wd/hub/session 500 9977.276 ms - 525

Simulator Script Used: package com.example.appium; import java.net.MalformedURLException; import java.net.URL; import org.openqa.selenium.By; import io.appium.java_client.ios.IOSDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.remote.DesiredCapabilities;

public class IOSSimulatorWithIOSDriver {

@SuppressWarnings("rawtypes")
public static void main(String... args) throws InterruptedException, MalformedURLException{
    DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
    desiredCapabilities.setCapability("platformName", "iOS");
    desiredCapabilities.setCapability("platformVersion", "9.0");
    desiredCapabilities.setCapability("deviceName", "iPhone 6");
    desiredCapabilities.setCapability("browserName", "Safari"); 

    IOSDriver<?> driver;
    driver= new IOSDriver(new URL("http://127.0.0.1:4723/wd/hub"), desiredCapabilities);
    driver.get("http://www.google.com");
    WebElement ele =driver.findElement(By.name("q"));
    ele.click();
    ele.sendKeys("Packt Publishing");
    WebElement searchButton =
    driver.findElement(By.name("btnG"));
    System.out.println(searchButton.getSize());
    searchButton.click();
    Thread.sleep(5000);
    driver.quit();
}

}

Note: I’m new to appium and if this is an easy setup fix, let me know what I’m doing wrong and please help me to set it up correctly to run tests. Thank you for looking into this.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:30 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
ghostcommented, Nov 8, 2015

Finally someone kindly shared a workaround for this issue with me. This worked for me. Finally after a month of headaches. Go to iOS advance settings in the GUI app and check Use Native Instruments Library and check Instruments Launch Timeout and set to 900,000 ms or a number of your choice so it has enough time to load before failing. Then I was able to open a browser in iOS Simulator 9.1. You have to manually type in 9.1 in the GUI app. Hopefully this issue will be fixed soon, so we don’t need to do a workaround.

0reactions
lock[bot]commented, Apr 29, 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

Appium 1.4.13 both the Android and iOs tests are failing
Issue : Cannot run tests with Simulators on Appium 1.4.13 - Simulator cannot Load and Crashes and Restarts in a Loop Running simulator......
Read more >
Appium 1.4.13 Released
If I install appium via npm, I have issue with it not installing SafariLauncher properly for real iOS device, gets error with iOS...
Read more >
Emulator with IOS9 Crashes on Appium 1.4.13 - Issues/Bugs
Hi all, I have encountered a major issue running an IOS application on Emulator which runs IOS9. Appium Server Works Fine but when...
Read more >
Unable to launch ios simulator on xcode 7 and appium 1.4.13
Issue : Cannot run tests with Simulators on Appium 1.4.13 - Simulator cannot Load and Crashes and Restarts in a Loop Running simulator....
Read more >
Appium inspector not working properly after upgrading to ...
When I try to run automated tests on the iOS simulator after upgrading Appium to 1.4.13 and OS X to El Capitan, the...
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