iOS 升级Xcode10遇到的问题及其解决方法

1.mac下出现xcrun: error导致git无法使用的解决办法

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun

解决方法:在终端输入

xcode-select --install

下载Xcode插件后即可恢复正常。

2.Xcode10导入头文件闪退问题

解决方法:选择File ---> workspace settings --->build system 改成legacy Build System 即可。

3.双击文件不在新窗口打开问题

解决方法:Xcode ---> Preferences --->Navigation

Double Click Navigation 改为 Uses Separate Window 即可。

4.运行工程出现错误提示 library not found for -lstdc++.6.0.9

解决方法:

拷贝旧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, butnotbuiltforiOS 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这里时需要右键显示包内容)。


原文来源:https://www.jianshu.com/p/2cc3ab5091cf

你可能感兴趣的:(iOS 升级Xcode10遇到的问题及其解决方法)