Xcode升级11.4之后,svn命令不可用用的解决办法

我们经常在命令行中使用svn命令,今天在升级Xcode到11.4之后,突然发现这个命令不可以用了,提示错误如下:

svn: error: Failed to locate 'svn'.

svn: error: The subversion command line tools are no longer provided by Xcode.

查看了各种办法,发现在/usr/bin/文件下面有svn文件,但是在/Applications/Xcode.app/Contents/Developer/usr/bin/中却找不到这个文件了,在之前的Xcode 11.3的版本中还存在这个文件

后面尝试各种办法,由于Xcode11.4刚出,网上也还没人遇到这种问题,突然发现了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命令,结果出现错误

xcode-select: error: command line tools are already installed, use "Software Update" to install updates

经过网上查找,找到如下的解决方法

1. 删除之前安装的command line tools

    sudo rm -rf /Library/Developer/CommandLineTools

2. 重新安装

    xcode-select --install

开始安装流程,安装成功后,再次尝试svn co的命令,成功

你可能感兴趣的:(Xcode升级11.4之后,svn命令不可用用的解决办法)