Skip to content

Instantly share code, notes, and snippets.

@axetroy
Created December 1, 2019 10:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save axetroy/137f560340b3cebaaf7d5ddc7fc8628c to your computer and use it in GitHub Desktop.
Save axetroy/137f560340b3cebaaf7d5ddc7fc8628c to your computer and use it in GitHub Desktop.
卸载 xcode

xcode 太庞大,而我又用不到 xcode,只能卸载

在卸载 xcode 之后 Git 命令不起作用了

$ git
xcrun: error: active developer path 
("/Applications/Xcode.app/Contents/Developer") 
does not exist, use `xcode-select --switch path/to/Xcode.app` 
to specify the Xcode that you wish to use for command line 
developer tools (or see `man xcode-select`)

原因是 git 依赖 CommandLineTools,这是 xcode 的一部分

解决办法:

$ xcode-select --install # 安装 CommandLineTools
$ sudo xcode-select --switch /Library/Developer/CommandLineTools # 指定路径
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment