解決方法:
拷貝舊Xcode中的庫。沒有的可以直接去github下載下傳:
https://github.com/zhuozhuo/libstdc-.6.0.9
真機路徑:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.0.sdk/usr/lib
模拟器路徑:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/lib
替換完成後在模拟器iOS10.0以上運作會出現一個錯誤:
Reason: no suitable image found. Did find:
/usr/lib/libstdc++.6.dylib: mach-o, but not built for iOS simulator
這裡還需要拷貝舊Xcode中的/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并改名為libstdc++.6.dylib後粘貼到新Xcode同樣的位置。(注意在/Profiles/Runtimes/iOS.simruntime這裡時需要右鍵顯示包内容)。