升级 Xcode 或者系统的时候遇到的 Git 使用不了的问题:

  1. dyld: Library not loaded: @rpath/libswiftCore.dylib
  2. Referenced from: /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild
  3. Reason: image not found
  4. git: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly!
  5. git: error: You can set the path to the Xcode folder using /usr/bin/xcode-select -switch

执行命令可解决:

  1. sudo xcode-select --switch /Library/Developer/CommandLineTools/

Flutter doctor

Once installed, run:

  1. sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
  2. sudo xcodebuild -runFirstLaunch

资料