iOS 13.0模拟器运行时不可用。

7
我安装了 macOS 10.15 beta 和 Xcode-11-beta。一开始我能正常使用 SwiftUI 预览功能。但是在我尝试将最初安装在“~/Downloads”目录中的 Xcode-beta 移动到“/Applications”目录后,预览就无法工作了。以下是错误信息: enter image description here 然后我把它移回“~/Downloads”,希望能像以前一样正常运行,但是它显示相同的错误。
之后,我重新安装了 Xcode,但仍然出现相同的错误。有人可以帮我解决吗?
诊断报告的内容如下:
== DATE:

Wednesday, June 5, 2019 at 10:25:46 PM China Standard Time



== PENDING U

    PDATE REASONS:





== PREVIEW UPDATE ERROR:

    unexpected error occurred

    Error Domain=com.apple.CoreSimulator.SimError Code=161 "The iOS 13.0 simulator runtime is not available." UserInfo={NSLocalizedRecoverySuggestion=Download the iOS 13.0 simulator runtime from the Components section in Xcode's Preferences., NSLocalizedFailureReason=runtime path not found, NSLocalizedDescription=The iOS 13.0 simulator runtime is not available.}



== VERSION INFO:

    Tools: 11M336w

    OS:    19A471t



== ENVIRONMENT:

    [x] In valid workspace
    [x] Project is using the new build system
        Previews are available for targets that are built with the new build system. Change your project to use the new build system.
    [x] Selected scheme (Landmarks)
        Select a scheme from the scheme picker in the toolbar
    [x] Selected run destination (iPhone 8)
        Select a run destination from the scheme picker in the toolbar
    [x] Have workspace arena
        Try quitting and reopening your workspace
    [x] Have build arena
        Try quitting and reopening your workspace
    [x] Open file has supported build settings
3个回答

29

CoreSimulator目前不支持将simruntime捆绑包移动到其下。通过从~/Downloads启动,它意识到了iOS 13的iOS.simruntime,然后您又将其移动了。

在这种特定情况下,您可以通过终止com.apple.CoreSimulator.CoreSimulatorService来解决问题。


我也遇到了这个问题,杀掉CoreSimulatorService就解决了。这应该是被接受的答案。完全重启是不必要的。 - Steven Peterson
这样的绝对陈述既没有帮助,更重要的是,特别不准确。我很高兴杀掉了CoreSimulatorService对您有用。但它对我无效。全面重启也无济于事。相反,我发现以下帖子中的建议有用。如果考虑到我们所有“机器”的配置都非常不同,那么你的评论显示出一个“被接受的答案”本身的缺陷(在我看来是致命的)。也许现在是时候讨论这个想法本身的有效性了?帖子链接:https://dev59.com/v1MH5IYBdhLWcg3w_GTX - Joseph Beuys' Mum
5
对我而言,"killall com.apple.CoreSimulator.CoreSimulatorService" 是可行的命令。 - Gene Z. Ragan

17

奇怪的是,早上我起床打开电脑后,CanvasiOS 13.0模拟器现在可以正常工作。

所以,我想这个问题的解决方法可能只需要粗暴地重新启动电脑。;]


3

XCode 11的更新以一种奇怪的方式破坏了模拟器,我不完全理解 - 升级后我尝试的所有操作都不能使模拟器正常运行,而且我很难找到明确的答案来解释为什么会出现这种情况,但以下两个命令解决了我的问题:

  • sudo xcrun simctl shutdown all
  • sudo xcrun simctl erase all

嗨..我现在使用的是Xcode 11.3,需要使用旧的10.3.1模拟器。我已经使用以下命令创建了它:$ xcrun simctl create "iPhone 6" "iPhone 6" iOS10.3.1 14E8301 37FAE547-CB68-4B76-81A3-8E748CC590B1。现在模拟器已经存在,并且我确认已安装运行时,使用命令xcrun simctl list devicetypes runtimes可以看到iOS 10.3 (10.3.1 - 14E8301) - com.apple.CoreSimulator.SimRuntime.iOS-10-3。但是我无法让新的模拟器出现在运行时目标列表中,因此无法选择它来运行我的项目。你遇到过这种情况吗? - imobilizer

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接