我安装了 macOS 10.15 beta 和 Xcode-11-beta。一开始我能正常使用 SwiftUI 预览功能。但是在我尝试将最初安装在“~/Downloads”目录中的 Xcode-beta 移动到“/Applications”目录后,预览就无法工作了。以下是错误信息:
然后我把它移回“~/Downloads”,希望能像以前一样正常运行,但是它显示相同的错误。
之后,我重新安装了 Xcode,但仍然出现相同的错误。有人可以帮我解决吗?
诊断报告的内容如下:
![enter image description here](https://istack.dev59.com/bw05j.webp)
之后,我重新安装了 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
CoreSimulatorService
就解决了。这应该是被接受的答案。完全重启是不必要的。 - Steven PetersonCoreSimulatorService
对您有用。但它对我无效。全面重启也无济于事。相反,我发现以下帖子中的建议有用。如果考虑到我们所有“机器”的配置都非常不同,那么你的评论显示出一个“被接受的答案”本身的缺陷(在我看来是致命的)。也许现在是时候讨论这个想法本身的有效性了?帖子链接:https://dev59.com/v1MH5IYBdhLWcg3w_GTX - Joseph Beuys' Mum