8

我安装了 Xcode-11-beta 和 macOS 10.15 beta。一开始能正常玩SwiftUI preview。但是在我尝试将 Xcode-beta 从~/Downloads最初安装它的目录移动到之后/Applications,预览无法正常工作。这是错误:

在此处输入图像描述

所以我把它移回了~/Downloads,希望事情会像以前一样顺利。但它给出了同样的错误。

在此之后,我重新安装它,我仍然得到这个错误。任何人都可以帮我解决它吗?

诊断报告的内容是这样的:

== 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
4

3 回答 3

25

CoreSimulator 目前不喜欢simruntime从它下面移出捆绑包。通过从~/Downloads它启动后,您会发现iOS.simruntime适用于 iOS 13,然后您就移动了它。

在这种特定情况下,您可以通过杀死com.apple.CoreSimulator.CoreSimulatorService.

于 2019-06-25T04:16:21.403 回答
17

奇怪的是我早上醒来,启动我的电脑,Canvas现在iOS 13.0 Simulator可以工作了。

所以,我想解决这个问题可能只是一个残酷的重启。;]

于 2019-06-06T00:56:36.370 回答
3

XCode 11 升级以一种我不完全理解的奇怪方式破坏了模拟器 - 我没有尝试过让模拟器在升级后运行,而且我找不到太多关于为什么会这样的明确答案情况,但以下两个命令为我解决了这个问题:

  • sudo xcrun simctl shutdown all
  • sudo xcrun simctl erase all
于 2019-10-30T23:08:23.833 回答