每次卸载Xcode 11,重装 缺少libstdc++.6.0.9的解决方案、运行模拟器时报错问题

申明,这个是转载于 https://www.codeleading.com/article/61772375451/

技术标签: xcode  ios  libstdc++.6.0.9

libstdc++.6.0.9.dylib、libstdc++.6.dylib、libstdc++.dylib下载目录如下

链接: https://pan.baidu.com/s/1Ep4fk5Lwsv56zRSoDqLWwg&shfl=shareset 提取码: ncme

更新Xcode11后因为缺少libstdc++.6.dylib文件报错,按照Xcode10的方法设置后运行模拟器发现还是报错,错误如下:

  1. Reason: no suitable image found. Did find:
  2.  /usr/lib/libstdc++.6.dylib: mach-o, but not built for iOS simulator
  3.  复制代码

根据原来Xcode10的设置方法,需要将就Xcode的如下路径的libstdc++.6.0.9.dylib、libstdc++.6.dylib、libstdc++.dylib三个文件拷贝到新的Xcode对应路径中,路径如下:

  1.  /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
  2.  复制代码

但是发现Xcode11的/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library路径中并没有CoreSimulator文件夹,所以无法设置。

查找资料后发现Xcode11的CoreSimulator文件夹被移至到/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/这个路径下,所以将旧的Xcode中的libstdc++.6.0.9.dylib、libstdc++.6.dylib、libstdc++.dylib三个文件移至新目录下就可以解决上述问题。路径如下:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/
原文地址:https://www.cnblogs.com/GUANGANJIUQI/p/13693944.html