首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何从命令行更新Xcode

如何从命令行更新Xcode
EN

Stack Overflow用户
提问于 2016-01-06 01:14:20
回答 15查看 479.5K关注 0票数 461

我正在尝试从命令行更新Xcode。最初,我尝试运行:

代码语言:javascript
复制
 xcode-select --install

这导致了这条消息:

代码语言:javascript
复制
xcode-select: error: command line tools are already installed, use "Software Update" to install updates

所以问题仍然存在,有没有一种方法可以从命令行更新Xcode?

EN

回答 15

Stack Overflow用户

发布于 2018-01-07 12:57:29

当我卸载完整版本的Xcode以重新安装CLI版本时,我遇到了同样的问题。我的解决方案是:

sudo xcode-select -s /Library/Developer/CommandLineTools

票数 66
EN

Stack Overflow用户

发布于 2019-02-01 20:35:24

安装命令行工具(使用xcode-select --install)后,键入:

代码语言:javascript
复制
sudo xcode-select --switch /Library/Developer/CommandLineTools/

你现在应该可以运行git了:

代码语言:javascript
复制
10:29 $ git --version
git version 2.17.2 (Apple Git-113)
票数 23
EN

Stack Overflow用户

发布于 2017-11-16 04:12:40

在删除Xcode后,我得到了这个错误。我通过用sudo xcode-select -r重置命令行工具路径修复了这个问题。

之前:

代码语言:javascript
复制
navin@Radiant ~$ /usr/bin/clang
xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist
Use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --install` to install the standalone command line developer tools.
See `man xcode-select` for more details.

navin@Radiant ~$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates

之后:

代码语言:javascript
复制
navin@Radiant ~$ /usr/bin/clang
clang: error: no input files
票数 22
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34617452

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档