簡體   English   中英

Xcode 12 模擬器崩潰

[英]Xcode 12 simulator crash

我在 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    

在此處輸入圖片說明

在此處輸入圖片說明

編輯添加異常斷點后,獲得以下控制台輸出

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。 它沒有鏈接,也沒有被豆莢使用,我已經檢查過了

我的解決方案:從 Xcode 12 beta 6 手動復制 libnfshared.dylib 到:Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr /庫/

這對我有用。 💯

如果您想避免為單個文件下載 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的模擬器會在啟動后iOS14崩潰。 較舊的 iOS 模擬器和部署到具有iOS14的設備運行良好。

我的解決方案:從 Xcode 12 beta 6 手動復制libnfshared.dylib到:

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 beta 2。2020 年 9 月 29 日發布。

等待穩定版本以確認事情是否像測試版一樣按預期工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM