更新Xcode11後由於缺乏libstdc++.6.dylib文件報錯,按照Xcode10的方法設置後運行模擬器發現仍是報錯,錯誤以下:c++
Reason: no suitable image found. Did find:
/usr/lib/libstdc++.6.dylib: mach-o, but not built for iOS simulator
複製代碼
根據原來Xcode10的設置方法,須要將就Xcode的以下路徑的libstdc++.6.0.9.dylib、libstdc++.6.dylib、libstdc++.dylib
三個文件拷貝到新的Xcode對應路徑中,路徑以下:bash
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libstdc++.6.0.9.dylib
複製代碼
可是發現Xcode11的/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library
路徑中並無CoreSimulator
文件夾,因此沒法設置。app
查找資料後發現Xcode11的CoreSimulator
文件夾被移至到/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/
這個路徑下,因此將舊的Xcode中的libstdc++.6.0.9.dylib、libstdc++.6.dylib、libstdc++.dylib
三個文件移至新目錄下就能夠解決上述問題。路徑以下:ui
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/
複製代碼