xcode iOS 模拟器:无效的设备状态

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32049566/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 07:41:14  来源:igfitidea点击:

iOS Simulator: Invalid device state

iosxcodeios-simulator

提问by codekidX

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".

我刚刚从 App Store 下载了 Xcode 6.4 并开始创建一个 hello world 应用程序来快速学习,但我收到错误消息“设备状态无效”。

Screenshot 1

截图 1

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.
  1. 重新启动 Mac 并进入 xcode 并启动项目(如堆栈溢出线程中所述)
  2. 我使用另一种布局创建了一个新的 iOS 应用程序,但如果我运行该项目,则再次显示相同的错误。
  3. 我删除了所有项目并再次重新安装了 Xcode。开始一个新项目并运行它,但仍然出现相同的错误。

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

我正在运行 Yosemite 10.10.1,Xcode 版本是 6.4。

Can anyone help me ?

谁能帮我 ?

回答by Jeremy Huddleston Sequoia

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.

如果在旧版本的 Xcode 中出现错误,设备可能会卡在创建状态。这在 Xcode 7 中的某个时候得到了修复,但我不确定修复是否使它回到 Xcode 6.x 版本中。

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 '.

从 Terminal.app,请运行“xcrun simctl list”。找到您尝试启动的设备的 UDID。如果它停留在“正在创建”状态,您可以尝试通过运行“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.

附带说明一下,我建议您更新操作系统。自 10.10.1 以来,有很多质量修复。10.10.5刚出来。

回答by rgreso

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

尝试从原来的模拟器切换到新的模拟器(例如从 iphone 6 到 6plus),然后再切换回原来的模拟器(iphone 6),应该没问题