如何解决Xcode 12模拟器崩溃
启动后,我在Xcode 12模拟器中收到奇怪的崩溃,信号为SIGABRT。它发生在Xcode 12.0和Xcode 12.0.1的发行版本上 我尝试使用最新的Beta 12.2。
应用在设备上运行正常。
由于日志较少,我无法追踪太多内容。以下是堆栈。
线程1
dyld`__abort_with_payload:
0x1194b0ed4 <+0>: movl $0x2000209,%eax ; imm = 0x2000209
0x1194b0ed9 <+5>: movq %rcx,%r10
0x1194b0edc <+8>: syscall
-> 0x1194b0ede <+10>: jae 0x1194b0ee8 ; <+20>
0x1194b0ee0 <+12>: movq %rax,%rdi
0x1194b0ee3 <+15>: jmp 0x1194af408 ; cerror_nocancel
0x1194b0ee8 <+20>: retq
0x1194b0ee9 <+21>: nop
0x1194b0eea <+22>: nop
0x1194b0eeb <+23>: nop
EDIT添加异常断点后,获得以下控制台输出
dyld: Library not loaded: /usr/lib/libnfshared.dylib
Referenced from: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreNFC.framework/CoreNFC
Reason: no suitable image found. Did find:
/usr/lib/libnfshared.dylib: mach-o,but not built for platform iOS-sim
在我的项目中,我没有使用CoreNFC。它没有链接,也没有被Pod使用,我已经检查过了
解决方法
我的解决方案:将libnfshared.dylib从Xcode 12 beta 6手动复制到: Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib /
这对我有用。 ?
如果要避免为单个文件下载11.25GB Xcode 12.2 beta的麻烦。我有文件要共享。
您可以执行以下命令来下载并将其放置在Xcode包中:
sudo curl https://storage.googleapis.com/mobile-simulator-build/libnfshared.dylib -o /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libnfshared.dylib
希望有帮助?
,我遇到了一个相同的问题,即iOS14
的模拟器在启动后立即崩溃。较旧的iOS模拟器并使用iOS14
部署到设备上可以正常工作。
我的解决方案:
将libnfshared.dylib
从Xcode 12 beta 6手动复制到:
Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib /
在发行版本中似乎缺少此文件。
,我希望这会有所帮助:
从目标/应用/构建设置中删除“ VALID_ARCHS”。
如果您拥有Bitrise版本,则建议添加:arm64 x86_64。 因为某些原因,如果删除“ VALID_ARCHS”,Bitrise当前将崩溃。
示例:
,此问题已得到解决
Xcode-12.2 beta2。于2020年9月29日发布。
等待稳定版本以确认是否像预期的那样工作正常。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。