xcode10升级后报找不到libstdc++.6.0.9相关问题的解决办法

升级到Xcode10,由于iOS12移除了libstdc++.6.0.9,所以好的办法就是把这个库用libc++替换掉。但是项目中有的第三方的静态库里面使用到了,并且还没来得及修复这个问题,实在是没得什么好办法,所以就暂时把Xcode9中的libstdc++移动到了Xcode10对应目录下,之后再处理了。
具体操作命令,打开终端

cp /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libstdc++.* /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/

cp /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libstdc++.* /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/

启动模拟器后报/usr/lib/libstdc++.6.dylib: mach-o, but not built for iOS simulator

dyld: Library not loaded: /usr/lib/libstdc++.6.dylib
  Referenced from: /Users/ygs/Library/Developer/CoreSimulator/Devices/516CEBE8-FB9B-4E64-B4B2-D02685CD7309/data/Containers/Bundle/Application/19732BC1-0D80-416D-A0C4-CCDE254AFE72/Youngs.app/Youngs
  Reason: no suitable image found.  Did find:
    /usr/lib/libstdc++.6.dylib: mach-o, but not built for iOS simulator
Message from debugger: Terminated due to signal 6

解决方法是,还需要拷贝旧Xcode中的/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libstdc++.6.dylib 粘贴到新Xcode同样的位置。(注意在/Profiles/Runtimes/iOS.simruntime这里时需要右键显示包内容)

其它说明

标签: IOS


阿里云优惠主机

添加新评论

免责声明
本博客部分内容来自于互联网,不代表作者的观点和立场,如若侵犯到您的权益,请联系[email protected]。我们会在24小时内进行删除。