Simctl error running 'create': Invalid runtime

Hi all,

I encountered this error while running what was once a successful test automation.

Error: Could not create simulator with name 'appiumTest-c609fc4a-c383-47c7-9d1f-dbc6949321ab', device type id 'iPhone 6' and runtime id '10.3'. Reason: 'simctl error running 'create': Invalid runtime: 10.3'

My search on the web was fruitless as it referred more to device issues than the above.

Has anyone encountered this problem?

1 Like

what is the version of Xcode you are using?

Xcode is Version 8.3.3

do you get the same error with other simulator and platform versions, post the complete Appium console log.

I did not use the test on other simulators or platforms.

Here is my log from Appium desktop

[Appium] Welcome to Appium v1.6.4
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session {“desiredCapabilities”:{“app”:"/Users/xxxx/Documents/Work/Experiments/_appiumApps/testAppiumApp.app",“automationName”:“XCUITest”,“deviceName”:“iPhone Simulator”,“platformName”:“iOS”,“newCommandTimeout”:0,“connectHardwareKeyboard”:true}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{“app”:"/Users/xxxx/Documents/Work/Experiments/_appiumApps/testAppiumApp.app",“automationName”:“XCUITest”,“deviceName”:“iPhone Simulator”,“platformName”:“iOS”,“newCommandTimeout”:0,“connectHardwareKeyboard”:true},null,null,null,null]
[BaseDriver] Event ‘newSessionRequested’ logged at 1497256836062 (16:40:36 GMT+0800 (+08))
[Appium] Creating new XCUITestDriver (v2.27.2) session
[Appium] Capabilities:
[Appium] app: ‘/Users/xxxx/Documents/Work/Experiments/_appiumApps/testAppiumApp.app’
[Appium] automationName: ‘XCUITest’
[Appium] deviceName: ‘iPhone Simulator’
[Appium] platformName: ‘iOS’
[Appium] newCommandTimeout: 0
[Appium] connectHardwareKeyboard: true
[XCUITest] XCUITestDriver version: 2.27.2
[BaseDriver] Session created with session id: c609fc4a-c383-47c7-9d1f-dbc6949321ab
[XCUITest] Xcode version set to ‘8.3.3’ (tools v8.3.2.0.1.1492020469)
[XCUITest] iOS SDK Version set to ‘10.3’
[BaseDriver] Event ‘xcodeDetailsRetrieved’ logged at 1497256836301 (16:40:36 GMT+0800 (+08))
[XCUITest] Changing deviceName from ‘iPhone Simulator’ to ‘iPhone 6’
[XCUITest] Simulator udid not provided, using desired caps to create a new simulator
[XCUITest] No platformVersion specified. Using latest version Xcode supports: ‘10.3’ This may cause problems if a simulator does not exist for this platform version.
[simctl] Error: simctl error running ‘create’: Invalid runtime: 10.3
at Object.wrappedLogger.errorAndThrow (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-support/lib/logging.js:63:13)
at simCommand$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/node-simctl/lib/simctl.js:26:11)
at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as throw
at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at process._tickCallback (internal/process/next_tick.js:103:7)
Error: simctl error running ‘create’: Invalid runtime: 10.3
at Object.wrappedLogger.errorAndThrow (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-support/lib/logging.js:63:13)
at simCommand$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/node-simctl/lib/simctl.js:26:11)
at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as throw
at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at process._tickCallback (internal/process/next_tick.js:103:7)
[simctl] Error: Could not create simulator with name ‘appiumTest-c609fc4a-c383-47c7-9d1f-dbc6949321ab’, device type id ‘iPhone 6’ and runtime id ‘10.3’. Reason: ‘simctl error running ‘create’: Invalid runtime: 10.3’
at Object.wrappedLogger.errorAndThrow (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-support/lib/logging.js:63:13)
at createDevice$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/node-simctl/lib/simctl.js:95:9)
at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as throw
at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at process._tickCallback (internal/process/next_tick.js:103:7)
Error: Could not create simulator with name ‘appiumTest-c609fc4a-c383-47c7-9d1f-dbc6949321ab’, device type id ‘iPhone 6’ and runtime id ‘10.3’. Reason: ‘simctl error running ‘create’: Invalid runtime: 10.3’
at Object.wrappedLogger.errorAndThrow (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-support/lib/logging.js:63:13)
at createDevice$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/node-simctl/lib/simctl.js:95:9)
at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as throw
at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at process._tickCallback (internal/process/next_tick.js:103:7)
[XCUITest] Error: Could not create simulator with name ‘appiumTest-c609fc4a-c383-47c7-9d1f-dbc6949321ab’, device type id ‘iPhone 6’ and runtime id ‘10.3’. Reason: ‘simctl error running ‘create’: Invalid runtime: 10.3’
at Object.wrappedLogger.errorAndThrow (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-support/lib/logging.js:63:13)
at createDevice$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/node-simctl/lib/simctl.js:95:9)
at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as throw
at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at process._tickCallback (internal/process/next_tick.js:103:7)
Error: Could not create simulator with name ‘appiumTest-c609fc4a-c383-47c7-9d1f-dbc6949321ab’, device type id ‘iPhone 6’ and runtime id ‘10.3’. Reason: ‘simctl error running ‘create’: Invalid runtime: 10.3’
at Object.wrappedLogger.errorAndThrow (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-support/lib/logging.js:63:13)
at createDevice$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/node-simctl/lib/simctl.js:95:9)
at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as throw
at GeneratorFunctionPrototype.invoke
at process._tickCallback (internal/process/next_tick.js:103:7)
[XCUITest] Not clearing log files. Use clearSystemFiles capability to turn on.
[MJSONWP] Encountered internal error running command: Error: Could not create simulator with name ‘appiumTest-c609fc4a-c383-47c7-9d1f-dbc6949321ab’, device type id ‘iPhone 6’ and runtime id ‘10.3’. Reason: ‘simctl error running ‘create’: Invalid runtime: 10.3’
at Object.wrappedLogger.errorAndThrow (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-support/lib/logging.js:63:13)
at createDevice$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/node-simctl/lib/simctl.js:95:9)
at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as throw
at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at process._tickCallback (internal/process/next_tick.js:103:7)
[HTTP] <-- POST /wd/hub/session 500 492 ms - 336

Capabilites are set as below

{
“automationName”: “XCUITest”,
“deviceName”: “iPhone Simulator”,
“platformName”: “iOS”,
“app”: “/Users/xxxx/Documents/Work/Experiments/_appiumApps/testAppiumApp.app”
}

This one below is from the IntelliJ Debugger
> org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{app=/Users/xxxx/Documents/Work/Experiments/_appiumApps/testAppiumApp.app, automationName=XCuiTest, platfomName=iOS, platformName=iOS, deviceName=iPhone 6}], required capabilities = Capabilities [{}]

Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'wssin2mac149', ip: 'fe80:0:0:0:1c29:2558:cf56:8571%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.4', java.version: '1.8.0_131'
Driver info: driver.version: IOSDriver

at io.appium.java_client.remote.AppiumProtocolHandShake.lambda$1(AppiumProtocolHandShake.java:96)
at java.util.Optional.orElseThrow(Optional.java:290)
at io.appium.java_client.remote.AppiumProtocolHandShake.createSession(AppiumProtocolHandShake.java:96)
at io.appium.java_client.remote.AppiumCommandExecutor.doExecute(AppiumCommandExecutor.java:111)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:162)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:250)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:236)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:137)
at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:38)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:88)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:112)
at io.appium.java_client.ios.IOSDriver.(IOSDriver.java:78)
at FirstTest.setUpTest(FirstTest.java:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

The capabilities are as below

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(“platfomName”, “iOS”);
capabilities.setCapability(“automationName”, “XCuiTest”);
capabilities.setCapability(“deviceName”, “iPhone 6”);
capabilities.setCapability(“app”, “/xxxx/_appiumApps/testAppiumApp.app”);
IOSDriver driver = new IOSDriver(new URL(“http://localhost:4723/wd/hub”), capabilities);

looks similar, set the platform version capability.

Yep yep, turns out to be that. It’s weird how it went through previously… :expressionless:

Thanks Venkatesh

Sometimes just checking the simulator type and setting the correct one helps:

  • Using instruments -s devices it will give you list of simulators
  • Get the simulator name you want
  • Set below desired capabilities(Python):
import unittest
from appium import webdriver

desired_caps = {}
desired_caps['platformName'] = 'iOS'
desired_caps['platformVersion'] = '13.4.1'
desired_caps['automationName'] = 'XCUITest'
desired_caps['deviceName'] = 'iPhone 11'
desired_caps['app'] = '/path/to/test.app' #Path to .app file
desired_caps['noReset'] = 'true'
desired_caps['ensureFreshSimulatorCreation'] = 'true'

driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
  • Sometimes it gives like below result when you hit: driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps):
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/site-packages/appium/webdriver/webdriver.py", line 151, in __init__
    proxy
  File "/usr/local/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "/usr/local/lib/python3.7/site-packages/appium/webdriver/webdriver.py", line 227, in start_session
    response = self.execute(RemoteCommand.NEW_SESSION, parameters)
  File "/usr/local/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: '13.4.1' does not exist in the list of simctl SDKs. Only the following Simulator SDK versions are available on your system: 13.4, 13.3, 6.1, 13.5, 6.2
  • So you can pick any platform version from the given list: 13.4, 13.3, 6.1, 13.5, 6.2
desired_caps['platformVersion'] = '13.4'

And that’s it.!