iOS17 和 Xcode 15 - 模拟器和预览立即崩溃

问题描述 投票:0回答:1

我最近有点疯狂,因为我根本无法使用Xcode和模拟器!今天,我清空了硬盘,安装了新的 macOS - Sonoma,从 App Store 安装了新的 Xcode 15,启动了一个新项目,然后……MacBook 崩溃了。我有 MacBook Pro 16 英寸 M1。 我尝试卸载 Xcode,然后手动安装它,我还尝试手动添加运行时 iOS17,每次我尝试启动和启动模拟器时 - 几乎立即崩溃。我是从 Xcode 还是从终端执行此操作并不重要。我的想法已经用完了,论坛上没有任何内容可以解决我的问题。我尝试了无数的解决方法,但没有人有效。顺便说一句,SwiftUI 预览也会崩溃。

我发现的是 CoreSimulator.log 文件,它基本上说根本看不到运行时 iOS。你知道 iOS 的运行时应该在哪里吗?

我使用苹果示例从终端添加它。 -

xcode-select -s /Applications/Xcode-beta.app
xcodebuild -runFirstLaunch
xcrun simctl runtime add "~/Downloads/watchOS 9 beta Simulator Runtime.dmg"

这是 CoreSimulator.log 文件的一部分

Sep 27 23:34:59 Vasils-MacBook-Pro CoreSimulatorService[742] <Notice>: com.apple.CoreSimulator.CoreSimulatorService 920.6 starting.
Sep 27 23:35:08 Vasils-MacBook-Pro CoreSimulatorService[742] <Notice>: Device Baca's iPhone (8303E065-924D-4E1E-8488-2A4457042532, iOS 17.0, Booted) encountered in unexpected state at launch: Booted.  Shutting down.
Sep 27 23:35:08 Vasils-MacBook-Pro CoreSimulatorService[742] <Error>: Unable to load device.plist: /Users/bacata.borisov/Library/Developer/CoreSimulator/Devices/DC8880C0-5D67-4DAA-95B6-75043F690485/device.plist
Sep 27 23:35:08 Vasils-MacBook-Pro CoreSimulatorService[742] <Error>: Failed to create device at path /Users/bacata.borisov/Library/Developer/CoreSimulator/Devices/DC8880C0-5D67-4DAA-95B6-75043F690485.
Sep 27 23:35:08 Vasils-MacBook-Pro com.apple.iphonesimulator[576] <Warning>: Unable to discover any Simulator runtimes. Developer Directory is /Applications/Xcode.app/Contents/Developer.
Sep 27 23:35:08 Vasils-MacBook-Pro CoreSimulatorService[742] <Warning>: Found duplicate SDKs for appletvos17.0:
        /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk
        /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS17.0.sdk
Sep 27 23:35:08 Vasils-MacBook-Pro CoreSimulatorService[742] <Warning>: Found duplicate SDKs for iphoneos17.0:
        /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk
        /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk
Sep 27 23:35:08 Vasils-MacBook-Pro CoreSimulatorService[742] <Warning>: Found duplicate SDKs for watchos10.0:
        /Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS10.0.sdk
        /Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk
Sep 27 23:35:08 Vasils-MacBook-Pro CoreSimulatorService[742] <Warning>: Unable to locate a suitable watch runtime for phone=iOS 17.0 (17.0 - 21A328) - com.apple.CoreSimulator.SimRuntime.iOS-17-0, wanted watch=(null)
Sep 27 23:35:10 Vasils-MacBook-Pro com.apple.dt.Xcode[548] <Warning>: Unable to discover any Simulator runtimes. Developer Directory is /Applications/Xcode.app/Contents/Developer.
Sep 27 23:35:10 Vasils-MacBook-Pro com.apple.dt.Xcode[548] <Warning>: Found duplicate SDKs for appletvos17.0:
        /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk
        /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS17.0.sdk
Sep 27 23:35:10 Vasils-MacBook-Pro com.apple.dt.Xcode[548] <Warning>: Found duplicate SDKs for iphoneos17.0:
        /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk
        /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk
Sep 27 23:35:10 Vasils-MacBook-Pro com.apple.dt.Xcode[548] <Warning>: Found duplicate SDKs for watchos10.0:
        /Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS10.0.sdk
        /Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk
Sep 27 23:35:30 Vasils-MacBook-Pro com.apple.CoreSimulator.simctl[895] <Warning>: Unable to discover any Simulator runtimes. Developer Directory is /Applications/Xcode.app/Contents/Developer.
Sep 27 23:35:42 Vasils-MacBook-Pro com.apple.CoreSimulator.simctl[920] <Warning>: Unable to discover any Simulator runtimes. Developer Directory is /Applications/Xcode.app/Contents/Developer.
Sep 27 23:35:42 Vasils-MacBook-Pro com.apple.CoreSimulator.simctl[920] <Error>: Failed to load liblaunch for runtime com.apple.CoreSimulator.SimRuntime.iOS-17-0: Error Domain=NSPOSIXErrorDomain Code=88 "Malformed Mach-o file" UserInfo={NSLocalizedDescription=Failed to open liblaunch_sim: dlopen(/Library/Developer/CoreSimulator/Volumes/iOS_21A328/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.0.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/host/liblaunch_sim.dylib, 0x0101): tried: '/Library/Developer/CoreSimulator/Volumes/iOS_21A328/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.0.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/host/liblaunch_sim.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Library/Developer/CoreSimulator/Volumes/iOS_21A328/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.0.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/host/liblaunch_sim.dylib' (no such file), '/Library/Developer/CoreSimulator/Volumes/iOS_21A328/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.0.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/host/liblaunch_sim.dylib' (no such file), NSLocalizedFailureReason=Malformed Mach-o file}
Sep 27 23:35:42 Vasils-MacBook-Pro com.apple.CoreSimulator.simctl[920] <Error>: Failed to setup launchHostClient for runtime com.apple.CoreSimulator.SimRuntime.iOS-17-0: Error Domain=NSPOSIXErrorDomain Code=88 "Malformed Mach-o file" UserInfo={NSLocalizedDescription=Failed to open liblaunch_sim: dlopen(/Library/Developer/CoreSimulator/Volumes/iOS_21A328/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.0.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/host/liblaunch_sim.dylib, 0x0101): tried: '/Library/Developer/CoreSimulator/Volumes/iOS_21A328/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.0.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/host/liblaunch_sim.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Library/Developer/CoreSimulator/Volumes/iOS_21A328/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.0.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/host/liblaunch_sim.dylib' (no such file), '/Library/Developer/CoreSimulator/Volumes/iOS_21A328/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.0.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/host/liblaunch_sim.dylib' (no such file), NSLocalizedFailureReason=Malformed Mach-o file}
Sep 27 23:35:50 Vasils-MacBook-Pro com.apple.CoreSimulator.simctl[926] <Warning>: Unable to discover any Simulator runtimes. Developer Directory is /Applications/Xcode.app/Contents/Developer.
Sep 27 23:44:13 Vasils-MacBook-Pro com.apple.dt.xcodebuild[1052] <Warning>: Unable to discover any Simulator runtimes. Developer Directory is /Applications/Xcode.app/Contents/Developer.
Sep 27 23:49:17 Vasils-MacBook-Pro CoreSimulatorService[1013] <Notice>: com.apple.CoreSimulator.CoreSimulatorService 920.6 starting.
Sep 27 23:49:17 Vasils-MacBook-Pro com.apple.dt.Xcode[999] <Warning>: Unable to discover any Simulator runtimes. Developer Directory is /Applications/Xcode.app/Contents/Developer.
:

这可能与权限问题有关吗?预先感谢您的建议

xcode macos ios-simulator simulator xcode15
1个回答
0
投票

作为总结。我花了大约两个月的时间来排除不同的软件问题,并且尝试了所有建议的解决方案。在我注意到我的 MacBook 与其他应用程序一起崩溃,有时甚至自行崩溃后,我决定将其带到当地的 Apple 服务中心,那里的人员进行了一些诊断,结果发现必须更换主板。更换后,我重新安装了所有东西 - 来自 App Store 的 Xcode,模拟器工作得非常顺利。我的日志中仍然有相同的错误,但不同的是一切都运行顺利。

幸运的是,我的 MacBook 在保修期内,我免费更换了所有东西。 如果您仍然遇到崩溃问题,我建议您将其带到当地的 Apple 服务中心,他们可以运行诊断程序并让您知道问题是由软件还是硬件引起的。 非常感谢所有的建议。现在可以关闭主题了

© www.soinside.com 2019 - 2024. All rights reserved.