title: Error: simctl error running 'create': Invalid device type: on appium and real ios device
body: <p>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.</p>
  
  <p>The device connected to the machine is recognized in xcode with the same name as bing provided in the code snippet. </p>
  
  <p><strong>Appium version</strong> : 1.6.3
  <strong>MAC OS Version</strong> : 10.12.2
  <strong>XCode Version</strong> : 8.2</p>
  
  <p><strong>Application Launch Code:</strong></p>
  
  <pre><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);
   }
  }
  </code></pre>
  
  <p><strong>Error I receive in Appium :</strong></p>
  
  <pre><code>[HTTP] --&gt; 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 &gt;= 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] &lt;-- POST /wd/hub/session 500 251 ms - 195
  </code></pre>