我正在尝试从命令行更新Xcode。一开始我试着跑步:
xcode-select --install
这就产生了这条信息:
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
那么问题来了,有没有办法从命令行更新Xcode呢?
我正在尝试从命令行更新Xcode。一开始我试着跑步:
xcode-select --install
这就产生了这条信息:
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
那么问题来了,有没有办法从命令行更新Xcode呢?
当前回答
使用这一行程序进行更新。
softwareupdate --install -a
其他回答
Xcode::Install是一个简单的命令行软件,允许你安装/选择特定的Xcode版本。
您可以使用gem install xcode-install安装它 然后,您将能够使用xcversion install 9.4.1安装特定的版本 如果您安装了多个版本,则可以使用xcversion select 9.4切换版本
你可以在https://github.com/KrauseFx/xcode-install上找到更多信息
在安装命令行工具(使用xcode-select——install)后,输入:
sudo xcode-select --switch /Library/Developer/CommandLineTools/
你现在应该可以运行git了:
10:29 $ git --version
git version 2.17.2 (Apple Git-113)
我能够通过CLI更新使用:
softwareupdate --list --verbose
然后
softwareupdate -i Command\ Line\ Tools\ for\ Xcode-13.2
xCode版本11.2.1对于在iPad 13.2.3中构建应用程序是必要的,当我直接尝试通过应用程序商店从xCode 11.1升级到11.2.1时,它被击中了,所以经过一些研究,我找到了一个解决方案,通过从系统中删除现有的xCode来升级
所以我在这里添加了卸载现有xcode后升级的步骤。
Go to Applications and identify Xcode and drag it to trash. Empty trash to permenently delete Xcode. Now go to ~/Library/Developer/ folder and remove the contents completely Use sudo rm -rf ~/Library/Developer/ to avoid any permission issue while deleting Lastly remove any cache directory associated with xcode in the path ~/Library/Caches/com.apple.dt.Xcode sudo rm -rf ~/Library/Caches/com.apple.dt.Xcode/* After completing the above steps you can easly install xcode from App Store, which will install the current latest version of xcode
注意:在进行上述更改之前,请备份现有项目
当我卸载完整版本的Xcode以重新安装CLI版本时,我遇到了同样的问题。我的解决方案是:
sudo xcode-select -s /Library/Developer/CommandLineTools