Xcode问题集锦

813 阅读1分钟

Xcode问题集锦

问题1.library not found for -lstdc++.6.0.9

报错原因:自iOS12.0中去掉了lstdc++.6.0.9.tbd动态库,全部采用libc++代替lstdc++的动态库.

解决方法:下载压缩包解压后用libstdc++.6.0.9.tbd 分别替换以下真机和模拟器libstdc++.6.0.9.tbd文件,路径如下

真机路径:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.0.sdk/usr/lib

注释:iPhoneOS12.0.sdk 也可能是iPhoneOS12.1.sdk或者更新版本

模拟器路径:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/lib

注释:iPhoneSimulator12.0.sdk 也可能是iPhoneSimulator12.1.sdk或者更新版本

问题2: no suitable image found. Did find:

/usr/lib/libstdc++.6.dylib: mach-o, but not built for iOS simulator

解决方法: 下载压缩包,使用压缩包中的libstdc++.6.dylib复制到下面路径即可

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib

问题3: error: tool 'xcodebuild' requires Xcode

原因:xcodebuild找不到Xcode,所以我们要重定向一下Xcode的文档的位置

$ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/