我們經(jīng)常在命令行中使用svn命令垦巴,今天在升級Xcode到11.4之后叨咖,突然發(fā)現(xiàn)這個(gè)命令不可以用了菲饼,提示錯(cuò)誤如下:
svn: error: Failed to locate 'svn'.
svn: error: The subversion command line tools are no longer provided by Xcode.
查看了各種辦法炫掐,發(fā)現(xiàn)在/usr/bin/文件下面有svn文件盲镶,但是在/Applications/Xcode.app/Contents/Developer/usr/bin/中卻找不到這個(gè)文件了仓蛆,在之前的Xcode 11.3的版本中還存在這個(gè)文件
后面嘗試各種辦法睁冬,由于Xcode11.4剛出,網(wǎng)上也還沒人遇到這種問題看疙,突然發(fā)現(xiàn)了Apple官方的Release Note 有下面的描述
Xcode
Deprecations
Command line tool support for Subversion — including?svn,?git-svn, and related commands — is no longer provided by Xcode. If you need Subversion or related command line tools, install the Command Line Tools package by running?xcode-select --install. (50266910)
接下來豆拨,就嘗試使用xcode-select --install命令,結(jié)果出現(xiàn)錯(cuò)誤
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
經(jīng)過網(wǎng)上查找能庆,找到如下的解決方法
1. 刪除之前安裝的command line tools
? ? sudo?rm -rf /Library/Developer/CommandLineTools
2. 重新安裝
? ??xcode-select --install
開始安裝流程施禾,安裝成功后,再次嘗試svn co的命令搁胆,成功