SamK
SamK

Reputation: 75

Error: simctl error running 'create': Invalid device type: on appium and real ios device

Unable to execute tests on MAC OS Sierra. Below is the environment information and the code snippets. In addition, you can find the error logs from appium. Any pointers on what information needs to be provided for devicename and why i am getting this error will help.

The device connected to the machine is recognized in xcode with the same name as bing provided in the code snippet.

Appium version : 1.6.3 MAC OS Version : 10.12.2 XCode Version : 8.2

Application Launch Code:

        public class TC_MobileLogin {
        public static AppiumDriver wd;
        @Test
        public void StartLogin() throws IOException {
        DesiredCapabilities capability = new DesiredCapabilities(); 
        capability.setCapability(MobileCapabilityType.PLATFORM_NAME,"iOS");
        capability.setCapability(MobileCapabilityType.PLATFORM_VERSION,"10.2");
        capability.setCapability(MobileCapabilityType.DEVICE_NAME,"iphone");
        File app = new File("/Users/samanth/Downloads/myapp.ipa");
        capability.setCapability("app", app.getAbsolutePath());
        wd = new IOSDriver(new URL("http://0.0.0.0:4723/wd/hub"), capability);
        wd.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS);
 }
}

Error I receive in Appium :

[HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"app":"/Users/samanth/Downloads/myapp.ipa","platformName":"iOS","deviceName":"iphone","platformVersion":"10.2"}}

[debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"/Users/samanth/Downloads/myapp.ipa","platformName":"iOS","deviceName":"iphone","platformVersion":"10.2"},null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null]

[Appium] Requested iOS support with version >= 10, using XCUITest driver instead of UIAutomation-based driver, since the latter is unsupported on iOS 10 and up.

[Appium] Creating new XCUITestDriver session

[Appium] Capabilities:
[Appium]   app: '/Users/samanth/Downloads/myapp.ipa'
[Appium]   platformName: 'iOS'
[Appium]   deviceName: 'iphone'
[Appium]   platformVersion: '10.2'
[debug] [XCUITest] XCUITestDriver version: 2.4.2
[BaseDriver] Session created with session id: 42938854-74eb-4c48-97e8-606f88b705b4
[debug] [XCUITest] Xcode version set to '8.2.1'
[debug] [XCUITest] iOS SDK Version set to '10.2'

[XCUITest] Simluator udid not provided, using desired caps to create a new simulator

**[simctl] Error: simctl error running 'create': Invalid device type: iphone**
    at Object.wrappedLogger.errorAndThrow (lib/logger.js:60:13)
    at simCommand$ (lib/simctl.js:22:11)
    at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
    at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)

 Error: simctl error running 'create': Invalid device type: iphone
    at Object.wrappedLogger.errorAndThrow (lib/logger.js:60:13)
    at simCommand$ (lib/simctl.js:22:11)
    at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
    at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)

[simctl] Error: simctl error running 'create': Invalid device type: iphone
    at Object.wrappedLogger.errorAndThrow (lib/logger.js:60:13)
    at simCommand$ (lib/simctl.js:22:11)
    at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
    at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)

 Error: simctl error running 'create': Invalid device type: iphone
    at Object.wrappedLogger.errorAndThrow (lib/logger.js:60:13)
    at simCommand$ (lib/simctl.js:22:11)
    at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
    at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)

[XCUITest] Error: simctl error running 'create': Invalid device type: iphone
    at Object.wrappedLogger.errorAndThrow (lib/logger.js:60:13)
    at simCommand$ (lib/simctl.js:22:11)
    at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
    at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)

 Error: simctl error running 'create': Invalid device type: iphone
    at Object.wrappedLogger.errorAndThrow (lib/logger.js:60:13)
    at simCommand$ (lib/simctl.js:22:11)
    at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
    at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)

[debug] [XCUITest] Running iOS simulator reset flow

[MJSONWP] Encountered internal error running command: Error: simctl error running 'create': Invalid device type: iphone
    at Object.wrappedLogger.errorAndThrow (lib/logger.js:60:13)
    at simCommand$ (lib/simctl.js:22:11)
    at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
    at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)

[HTTP] <-- POST /wd/hub/session 500 251 ms - 195

Upvotes: 4

Views: 4505

Answers (1)

wpj
wpj

Reputation: 206

Hi on latest appium you need to also add udid

capabilities.setCapability("udid", "3##########");

Upvotes: 5

Related Questions