Xcode beta 6 iOS 8:模拟器不工作

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24727397/
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-08-31 01:22:52  来源:igfitidea点击:

Xcode beta 6 iOS 8: Simulator not working

iosxcodeios6swiftxcode6

提问by JakeFromStateFarm

I cannot launch the simulator successfully. Once I launch the IOS Simulator this error appears:

我无法成功启动模拟器。一旦我启动 IOS 模拟器,就会出现这个错误:

"Unable to boot the IOS Simulator."

“无法启动 IOS 模拟器。”

Following the IOS Simulator error, I then get an error from Xcode reading:

在 IOS 模拟器错误之后,我从 Xcode 读取中得到一个错误:

Unable to run app in Simulator
An error was encountered while running (Domain = DTiPhoneSimulatorErrorDomain, Code = 2)

无法在模拟器中运行应用程序运行
时遇到错误(域 = DTiPhoneSimulatorErrorDomain,代码 = 2)

Screenshot for error

错误截图

UPDATE:

更新:

This might sound silly but I went to Xcode/preference/Downloads with intentions of seeing a IOS 8.0 Simulator but there was none. Could this be the problem? Am I suppose to have a IOS 8.0 Simulator? If so can someone direct me how to get it? Also, under the "Downloads" tab in Xcode preference I do see IOS 7.0 and 7.1 Simulators and both work fine with Xcode 5.

这听起来可能很傻,但我去 Xcode/preference/Downloads 是想看看 IOS 8.0 模拟器,但没有。这可能是问题吗?我应该有一个 IOS 8.0 模拟器吗?如果是这样,有人可以指导我如何获得它吗?此外,在 Xcode 首选项的“下载”选项卡下,我确实看到了 IOS 7.0 和 7.1 Simulators,并且它们都可以与 Xcode 5 一起正常工作。

回答by Flori

the trick is, to select the right command line tools! just select it here enter image description here

诀窍是,选择正确的命令行工具!只需在此处选择它 在此处输入图片说明

reboot(!) and everything is fine again :-)

重新启动(!),一切又好了:-)

回答by Anton

Ok It's known problem. Do you see simulators list? If not

好的,这是已知问题。你看到模拟器列表了吗?如果不

Goto Xcode Menu -> Open Developer Tool -> It will open a simulator in your Dock -> click on simulator then go to Simulator Menu: Hardware -> Device -> Manage Devices. Add needed simulators. Always try to run your app with different simulators.someone will work.

转到 Xcode 菜单 -> 打开开发者工具 -> 它将在你的 Dock 中打开一个模拟器 -> 单击模拟器然后转到模拟器菜单:硬件 -> 设备 -> 管理设备。添加所需的模拟器。总是尝试用不同的模拟器运行你的应用程序。有人会工作的。

回答by w0mbat

Restart your Mac. I just had that exact error after installing Xcode 6 beta 7, literally the only thing I did in response was reboot my Mac and now the iOS 8 simulator is working.

重新启动您的 Mac。在安装 Xcode 6 beta 7 后,我刚刚遇到了那个确切的错误,实际上我所做的唯一回应就是重新启动我的 Mac,现在 iOS 8 模拟器正在运行。

This error is common if you update Xcode without restarting afterwards.

如果您更新 Xcode 之后没有重新启动,则此错误很常见。

回答by eason

In my case, i reset ios simulator settings fix it.

就我而言,我重置了 ios 模拟器设置来修复它。

iOS Simulator -> Reset Content and Settings ...

iOS 模拟器 -> 重置内容和设置...

回答by Umar Farooq

  1. Open Xcode 6 beta
  2. Goto Window > Devices
  3. Click on the little + sign at the bottom
  4. Add (if missing) all the devices that you want, or delete and recreate if not working.
  5. If anyone of the simulator is not working then you can delete it and then re-create it again in this menu.
  1. 打开 Xcode 6 测试版
  2. 转到窗口 > 设备
  3. 点击底部的小+号
  4. 添加(如果缺少)您想要的所有设备,或者如果不起作用则删除并重新创建。
  5. 如果模拟器中的任何一个不工作,那么您可以将其删除,然后在此菜单中重新创建它。

enter image description here

在此处输入图片说明

回答by Abdul Rahman Khan

Just unset DYLD_INSERT_LIBRARIES environment variable in the /etc/launchd.conf or ~/.launchd.conf file. Which you can edit by sudo vi /etc/launchd.conf command. remove the above flag save it by "ZZ" (captial Z) and reboot the system. It works like a charm.

只需在 /etc/launchd.conf 或 ~/.launchd.conf 文件中取消设置 DYLD_INSERT_LIBRARIES 环境变量。您可以通过 sudo vi /etc/launchd.conf 命令进行编辑。删除上面的标志,用“ZZ”(大写Z)保存并重新启动系统。它就像一个魅力。

回答by pchelnikov

  • From the xCode 6 pull down menus, Xcode > Open Developer Tool > iOS Simulator (if you get a pop up error just dismiss it)
  • Once in the Simulator go to Hardware > Device > Manage Devices.
  • Delete everything listed under simulator.
  • Reboot your machine.
  • 从 xCode 6 下拉菜单中,Xcode > Open Developer Tool > iOS Simulator(如果出现弹出错误,请关闭它)
  • 进入模拟器后,转到硬件 > 设备 > 管理设备。
  • 删除模拟器下列出的所有内容。
  • 重新启动您的机器。

After that, navigate back to Manage Devices in the simulator and click the plus to add back your simulators. Then the iOS 8 simulators will show up.

之后,导航回模拟器中的管理设备,然后单击加号以重新添加您的模拟器。然后将显示 iOS 8 模拟器。

回答by Jon

I saw the same issue when I installed Xcode 6 beta 6, and deleted beta 4 and beta 5. Apparently, deleting the old betas also deleted the iOS Simulator 8 versions! Putting it back from my Trash solved the issue.

我在安装 Xcode 6 beta 6 时看到了同样的问题,并删除了 beta 4 和 beta 5。显然,删除旧的 beta 也删除了 iOS Simulator 8 版本!把它从我的垃圾箱里放回去解决了这个问题。

Solution: Don't delete old beta software!

解决方案:不要删除旧的测试版软件!

Edit: @Flori's solution worked. Was able to delete the old beta software, and after a complete system reboot, it worked again.

编辑:@Flori 的解决方案有效。能够删除旧的测试版软件,并在完全重新启动系统后,它再次工作。

回答by jki

Make sure that path in menu XCode>Preference>Locations point to XCode 6.0 (Restart Xcode after changing them). Then go to menu Window>Devices and add simulator devices you want to use.

确保菜单 XCode>Preference>Locations 中的路径指向 XCode 6.0(更改它们后重新启动 Xcode)。然后转到菜单窗口>设备并添加您要使用的模拟器设备。

回答by reshat2

I got this issue when moving from Beta 6 to Beta 7. Very frustrating. I could reset content and settings on any of the iOS 8 simulators. None of my iOS 8 simulators were working at all, just a black screen. I restarted my machine during the process, but I am not sure if it did anything. Initially I had only iOS 8 Simulators. I had to remove and reinstall Xcode6Beta7. I did not get the Install More Components the first time I installed it, I am not sure if that was the missing part. I installed the iOS 7 Simulators from Settings->Downloads because my iOS8 ones were not working. After I had reinstalled and relaunched the simulator, I then had a list of iOS 6,7,& 8 simulators. None of the iOS 8 Simulators were working. I was able to launch the iOS7 simulator and then using the device menu change to an iOS 8 Simulator. Some still did not work, I had to remove them and re-add them in the devices screen.

从 Beta 6 迁移到 Beta 7 时,我遇到了这个问题。非常令人沮丧。我可以在任何 iOS 8 模拟器上重置内容和设置。我的 iOS 8 模拟器根本没有工作,只是黑屏。我在这个过程中重新启动了我的机器,但我不确定它是否做了什么。最初我只有 iOS 8 模拟器。我不得不删除并重新安装 Xcode6Beta7。我第一次安装时没有安装更多组件,我不确定那是不是缺少的部分。我从“设置”->“下载”安装了 iOS 7 模拟器,因为我的 iOS8 模拟器无法正常工作。在我重新安装并重新启动模拟器后,我得到了一个 iOS 6、7 和 8 模拟器列表。没有一个 iOS 8 模拟器在工作。我能够启动 iOS7 模拟器,然后使用设备菜单更改为 iOS 8 模拟器。有些还是不行,

  1. Remove XCode6Betafrom Applications.
  2. Restart Machine (Just in case, this seems to solve some peoples issue completely)
  3. Install XCode6Beta.
  4. Verify the Install Additional Components ran.
  5. Launch Xcode6Beta.
  6. Preferences->General->Change Command Line Tools to Xcode 6.0.
  7. Restart Xcode.
  8. Preferences->Downloads->Download iOS 7 Simulator (If not already downloaded).
  9. Run App on iOS 7 Simulator (Or launch iOS Simulator and switch to iOS 7 device)
  10. If the iOS 7 Simulator is working, Hardware->Devices->Select an iOS 8 simulator.
  11. Delete and recreate any non working iOS 8 Simulators in Window->Devices from Xcode.
  1. XCode6Beta从应用程序中删除。
  2. 重启机器(以防万一,这似乎完全解决了一些人的问题)
  3. 安装XCode6Beta.
  4. 验证安装附加组件已运行。
  5. 启动 Xcode6Beta。
  6. 首选项-> 常规-> 将命令行工具更改为 Xcode 6.0。
  7. 重新启动Xcode
  8. Preferences->Downloads->Download iOS 7 Simulator(如果尚未下载)。
  9. 在 iOS 7 模拟器上运行应用程序(或启动 iOS 模拟器并切换到 iOS 7 设备)
  10. 如果 iOS 7 模拟器工作正常,硬件->设备->选择一个 iOS 8 模拟器。
  11. 在 Window->Devices 中从Xcode.