简体   繁体   English

Xcode 9 没有任何模拟器设备

[英]Xcode 9 doesn't have any simulator device

I just downloaded xcode 9 beta, but there is no simulator within it.我刚刚下载了 xcode 9 beta,但里面没有模拟器。 Try to add new simulator but the create button doesn't work.尝试添加新模拟器,但创建按钮不起作用。 Please help请帮忙

By "no simulator within it" I mean there is option to build with simulator. “其中没有模拟器”是指可以选择使用模拟器进行构建。

See在此处输入图片说明 . .

Also, the create button doesn't work此外,创建按钮不起作用在此处输入图片说明

Go to Xcode Preferences -> Locations and go to the Derived Data location in Finder:转到 Xcode Preferences -> Locations并转到 Finder 中的派生数据位置:

Xcode 偏好

Just remove all contents from it, then right click on Xcode icon and quit it, and reopen it:只需从中删除所有内容,然后右键单击 Xcode 图标并退出它,然后重新打开它:

移到废纸篓

它是一个模拟器,但如果您打开它并重新启动Xcode 9 beta,则需要关闭Xcode 8

This may happen due to multiple Xcode installed on machine or might be the deployment target is higher than the simulator OS version.这可能是由于机器上安装了多个 Xcode,或者可能是部署目标高于模拟器操作系统版本。

In order to resolve this navigate to following location : Xcode > Preference > location > comindline Tool > change the xcode version为了解决这个问题,请导航到以下位置:Xcode > Preference > location > comindline Tool > change the xcode version

and decrease the deployment target.并减少部署目标。

You may have removed iOS Simulators when you cleaned up disk space.您可能在清理磁盘空间时删除了 iOS 模拟器。 I think I may have used DaisyDisk to remove files when I ran out of space.我想我可能在空间不足时使用 DaisyDisk 来删除文件。

You can re-add simulators using the Devices & Simulators window.您可以使用设备和模拟器窗口重新添加模拟器。 (Shift + Command + 2) (Shift + 命令 + 2)

Xcode 9 设备和模拟器窗口

Delete the derived data, close all your running Xcodes and restart your computer.删除派生数据,关闭所有正在运行的 Xcode,然后重新启动计算机。 It just helped me.它只是帮助了我。

Apart from the simulators not showing, my project's storyboard was messed up also after upgrading to XCode 9. I simply restarted XCode and voila!除了模拟器没有显示之外,升级到 XCode 9 后,我的项目的故事板也搞砸了。我只是重新启动了 XCode,瞧! Did not have to delete derived files - though it would probably not hurt.不必删除派生文件 - 尽管它可能不会受到伤害。

You can do the same that @badhan-ganesh suggests (cleaning derived data) using the Xcode keyboard shortcut to clean derived data:您可以按照@badhan-ganesh 的建议(清理派生数据)使用 Xcode 键盘快捷键来清理派生数据:

shift+alt+cmd+k

If needed, you can clean the project using Xcode keyboard shortcut:如果需要,您可以使用 Xcode 键盘快捷键清理项目:

shift+cmd+k

After that, restart Xcode and simulators should be available again.之后,重新启动 Xcode,模拟器应该会再次可用。

部署目标高于模拟器上安装的目标也会导致这种情况。

Ensure your Deployment Target version in Build Settings is also set to the desired version (and that you have that version of the respective simulator installed).确保 Build Settings 中的 Deployment Target 版本也设置为所需版本(并且您安装了相应模拟器的该版本)。 Suppose, if that were set to 10.3 and I didn't have an iOS 10.3 simulator installed, I wouldn't be able to see any simulators.假设,如果将其设置为 10.3 并且我没有安装 iOS 10.3 模拟器,我将看不到任何模拟器。 But because it's set to 10.1, and I have 10.1 simulators installed, I can see them.但是因为它设置为10.1,并且我安装了10.1模拟器,所以我可以看到它们。

When my xcode updated to 9.4 I face the same problem at first time.当我的 xcode 更新到 9.4 时,我第一次遇到了同样的问题。 After force quit and start again solve the problem for me.强制退出并重新开始后为我解决问题。

If you upgraded Xcode then follow the steps如果您升级了 Xcode,请按照以下步骤操作

  1. Delete derived data, Xcode-> Preferences -> Locations and select arrow symbol just before Advance button -> select all files and delete.删除派生数据,Xcode-> Preferences -> Locations 并选择 Advance 按钮前的箭头符号 -> 选择所有文件并删除。
  2. Quit Xcode退出 Xcode
  3. Quit Xcode from Dock从 Dock 退出 Xcode
  4. Open Xcode again.再次打开Xcode。

:-) Hope this will help you. :-) 希望能帮到你。

I have Xcode 8.3 and Xcode 9.1, I came to this post to find a solution to missing simulators after forced upgrade to 9.1...我有 Xcode 8.3 和 Xcode 9.1,我来到这篇文章是为了寻找强制升级到 9.1 后缺少模拟器的解决方案......

I was about to do the suggestion to remove the entire DerivedData directory, lucky closing Xcode 9.1 and restarting it worked.我正要建议删除整个 DerivedData 目录,幸运的是关闭 Xcode 9.1 并重新启动它。 Moreover, I had to close all simulator(s).此外,我不得不关闭所有模拟器。

I had to rebuild app apps on simulator again.我不得不再次在模拟器上重建应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM