將以下命令中 Xcode9xxxx.app 改成你Xcode9的自定義名字
真機(jī)
sudo cp /Applications/Xcode9xxxx.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libstdc++.6.0.9.tbd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libstdc++.6.0.9.tbd
模擬器
sudo cp /Applications/Xcode9xxxx.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libstdc++.* /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/
替換完成后在模擬器iOS10.0以上運(yùn)行會(huì)出現(xiàn)一個(gè)錯(cuò)誤:
Reason: no suitable image found.? Did find:
? ? /usr/lib/libstdc++.6.dylib: mach-o, butnotbuiltforiOS simulator
sudo cp /Applications/Xcode9xxxx.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libstdc++.6.0.9.dylib /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib
拷貝進(jìn)去之后將名字改成libstdc++.6.dylib