1.mac下出現(xiàn)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.運行工程出現(xiàn)錯誤提示 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以上運行會出現(xiàn)一個錯誤:
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這里時需要右鍵顯示包內(nèi)容)。