Cannot start driver on iOS simulator

  • Platform: iOS
  • Appium version: 1.9.0
  • Emulator: XCode iPhone Simulator
  • Client langauage: Java
  • OS: OSX

I could not start driver, without error message. Is there anything wrong? I used testNG to set the capabilities by xml. The similar code works well for Android testing on Windows. The Xcode iPhone simulator is launched before running the program. By debugging, I found the setup fails when creating the driver.

.xml: (path to the .app is correct)

Java class:
public class AppiumTestCase {
protected AppiumDriver driver;

@Parameters({“port”, “platformName”, “platformVersion”, “deviceName”, “automationName”, “app”, “noReset”})
public void setUp(String appiumPort, String platformName, String platformVersion, String deviceName,
String automationName, String app, String noReset) {
System.out.println("[-----------Parameters-----------] port=" + appiumPort);
capabilities.setCapability(“platformName”, platformName);
capabilities.setCapability(“platformVersion”, platformVersion);
capabilities.setCapability(“deviceName”, deviceName);
capabilities.setCapability(“automationName”, automationName);
capabilities.setCapability(“app”, app);
capabilities.setCapability(“noReset”, noReset);
capabilities.setCapability(“showXcodeLog”, true);
capabilities.setCapability(“unicodeKeyboard”, true);
capabilities.setCapability(“resetKeyboard”, true);

try {
driver = new IOSDriver(new URL(“”+ appiumPort + “/wd/hub”), capabilities);
System.out.println("driver done "+driver);
wait = new WebDriverWait(driver,15);
} catch (MalformedURLException e) {
} catch (Exception exception) {


I am in onStart method Login
[-----------Parameters-----------] port=4723
Capabilities [{app=/Users/~/, noReset=true, showXcodeLog=true, platformVersion=11.4, automationName=XCUITest, unicodeKeyboard=true, platformName=iOS, deviceName=iPhone 5s, resetKeyboard=true}]
I am in onTestStart method login_Email start
I am in onTestSkipped method login_Email skipped
I am in onTestStart method login_MobileNumber start
I am in onTestSkipped method login_MobileNumber skipped
I am in onTestStart method login_WrongPassword start
I am in onTestSkipped method login_WrongPassword skipped
I am in onTestStart method login_WrongUsername start
I am in onTestSkipped method login_WrongUsername skipped
I am in onFinish method Login

Total tests run: 4, Failures: 0, Skips: 4
Configuration Failures: 1, Skips: 2

ConfigurationFailures: [[TestResult name=setUp status=FAILURE method=AppiumTestCase.setUp(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)[pri:0, instance:tests.LoginTest@12e61fe6] output={null}]]
FailedTests: []

According to your screenshot, this doesn’t have a value:

name="app" value=""

You need to set that as a path to the simulator build of your app.

Thanks for your reply.
The path has been set, I just covered the value by white color.
The value was like this: “/Users/yuki.chen/eclipse-workspace/commonFramework/src/main/resources/”, the value was got by copying the path to clipboard.

By the way, I am not using Appium desktop but start Appium by in-program command instead.

String cmd = appium + " --session-override " + " -p " + port + " -bp " + bootstrapPort + " --chromedriver-port " + chromeDriverPort + " -g " + logPath;
process = Runtime.getRuntime().exec(cmd);

After executing this, I can got input stream matching “Appium REST http interface listener started on”. Besides of the capabilities set in the XML, is there any additional configuration required to let Appium find the simulator?

You may want to debug this using the Appium Desktop and use it’s server just to make sure your capabilities are correct, then move backwards to setting up the appium server after that.

Couple questions regarding the failure to create the driver:

  1. Is the java client finding the appium server / connecting to it?
  2. Is the problem that the appium server doesn’t see the simulator?

I tried Appium Desktop and it can launch the app on the simulator, so I edited the capabilities/commands, removed bootstrap port and added webDriverAgent port. However, the program still doesn’t work.
As for the questions, I am not sure is the java client working well, but I used “-g” to save the server log, which is like this:

2018-10-02 02:39:59:259 - info: [Appium] Welcome to Appium v1.9.0
2018-10-02 02:39:59:263 - info: [Appium] Non-default server args:
2018-10-02 02:39:59:263 - info: [Appium] sessionOverride: true
2018-10-02 02:39:59:264 - info: [Appium] log: /Users/yuki.chen/eclipse-workspace/commonFramework/appium.log
2018-10-02 02:39:59:317 - info: [Appium] Appium REST http interface listener started on

And it seems that the server doesn’t see the simulator.
I also used breakpoints to debug the line creating the driver, after running the line, nothing shown in the variables list. Even try catch cannot get anything.

To check whether it is due to the java client, I deleted the java client jar file and use maven to import the java-client 6.1.0, then I got this error:

org.openqa.selenium.WebDriverException: It is impossible to create a new session because ‘createSession’ which takes HttpClient, InputStream and long was not found or it is not accessible
Build info: version: ‘3.4.0’, revision: ‘unknown’, time: ‘unknown’
System info: host: ‘local’, ip: ‘fe80:0:0:0:4a9:11d6:ec64:aeea%en0’, ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.13.6’, java.version: ‘10.0.2’
Driver info: driver.version: IOSDriver
at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(
at io.appium.java_client.remote.AppiumCommandExecutor.createSession(
at io.appium.java_client.remote.AppiumCommandExecutor.execute(
at org.openqa.selenium.remote.RemoteWebDriver.execute(
at io.appium.java_client.DefaultGenericMobileDriver.execute(
at io.appium.java_client.AppiumDriver.execute(
at io.appium.java_client.ios.IOSDriver.execute(
at org.openqa.selenium.remote.RemoteWebDriver.startSession(
at org.openqa.selenium.remote.RemoteWebDriver.startSession(
at org.openqa.selenium.remote.RemoteWebDriver.(
at io.appium.java_client.DefaultGenericMobileDriver.(
at io.appium.java_client.AppiumDriver.(
at io.appium.java_client.AppiumDriver.(
at io.appium.java_client.ios.IOSDriver.(
at tests.AppiumTestCase.setUp(
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(
at java.base/java.lang.reflect.Method.invoke(
at org.testng.internal.MethodInvocationHelper.invokeMethod(
at org.testng.internal.Invoker.invokeConfigurationMethod(
at org.testng.internal.Invoker.invokeConfigurations(
at org.testng.internal.Invoker.invokeConfigurations(
at org.testng.TestRunner.beforeRun(
at org.testng.SuiteRunner.runTest(
at org.testng.SuiteRunner.runSequentially(
at org.testng.SuiteRunner.privateRun(
at org.testng.SuiteRunnerWorker.runSuite(
at org.testng.TestNG.runSuitesSequentially(
at org.testng.TestNG.runSuitesLocally(
at org.testng.TestNG.runSuites(
at utilities.RunSuite.main(

Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(
at java.base/java.lang.reflect.Method.invoke(
at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(
… 35 more

Caused by: java.lang.AbstractMethodError: org.openqa.selenium.remote.internal.OkHttpClient.execute(Lorg/openqa/selenium/remote/http/HttpRequest;Z)Lorg/openqa/selenium/remote/http/HttpResponse;
at org.openqa.selenium.remote.ProtocolHandshake.createSession(
… 40 more

[UPDATE] I used java-client 6.0.0-BETA4 instead, then the test worked.
It seems that there is an issue on httpClient 6.1.0:
Although somebody suggested to use JitPack( to get the latest version, I prefer importing a released version instead of handling the tag number.

Anyway, thanks @wreed @bennid