iOS Simulator: Invalid device state

元气小坏坏 提交于 2019-12-10 07:38:37

问题


I just downloaded Xcode 6.4 from App Store and started to create a hello world app to learn swift but I get the error saying "Invalid Device State".

I googled a lot and tried the below things:

  1. Restarted Mac and entered xcode and started project (as mentioned in a stack overflow thread)
  2. I created a new iOS app with another layout but showed the same error again if I ran that project.
  3. I deleted all projects and re-installed Xcode again. Started a new project and ran it but still getting the same error.

I am running Yosemite 10.10.1 and the Xcode version is 6.4.

Can anyone help me ?


回答1:


Devices can get stuck in the creating state if errors occur in older versions of Xcode. This was fixed at some point in Xcode 7, but I'm not sure if the fix made it back into an Xcode 6.x release.

From Terminal.app, please run 'xcrun simctl list'. Locate the UDID of the device that you are attempting to boot. If it is stuck in the 'Creating' state, you can try recreating it by running 'xcrun simctl erase '.

If it is stuck in a different state, please update your question appropriately to indicate which state the device is stuck in.

On a side note, I suggest you update your OS. There have been a lot of quality fixes since 10.10.1. 10.10.5 just came out.




回答2:


Try to switch from your original simulator to new one (for example from iphone 6 to 6plus) and then switch back to original one (iphone 6) and it should be ok



来源:https://stackoverflow.com/questions/32049566/ios-simulator-invalid-device-state

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!