Mac使用Command Line Tools不用装Xcode

原创
2019/06/24 01:04
阅读数 1.9K

Mac使用Command Line Tools不用装Xcode

亲自测试过(请注意看错误提示)

-> 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`)

解决办法

xcode-select --install 	# 单独安装CommandLineTools,不需要Xcode
sudo xcode-select --switch /Library/Developer/CommandLineTools # 指定路径
(第二部可以不运行)
再执行 git,显示OK了。
-> git
usage: git [--version] [--help] [-C <path>] [-c name=value]
[--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
[-p | --paginate | --no-pager] [--no-replace-objects] [--bare]
[--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
<command> [<args>]
展开阅读全文
加载中

作者的其它热门文章

打赏
0
0 收藏
分享
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部