【MAC】升级 Mac os 后报错

背景

17 年买的 mac,发现很多软件都无法安装,于是升级 mac os 到 10.13,从官网下载 10.13 版本,之后升级,升级还算顺利。但使用 git 的时候发现出现问题了。

问题

使用 git 出现如下错误

复制代码
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

简单查了需要安装 xcode,通过 App Store 安装 xcode 发现,App Store 的 XCode 需要 13.x 版本的 mac os。

安装 xcode

从官网下载 10.13 版本对应的 xcode

  1. 双击 Xcode.xip 文件:
    文件应该开始自动展开。这个过程可能需要一些时间,取决于您的 Mac 的性能。
    展开后,您会看到一个叫 Xcode.app 的应用程序。
  2. 将 Xcode.app 拖放到您的 /Applications 目录。
    这将安装 Xcode 到您的应用程序目录中。

使用 git

安装完 xcode 之后,通过如下命令指定 CommandLineTools 的位置。

复制代码
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

至此 git 可以使用了。

相关推荐
德亦周9 小时前
如何在Mac电脑上的VScode去配置C/C++环境
c++·vscode·macos
tonngw16 小时前
【Mac 从 0 到 1 保姆级配置教程 12】- 安装配置万能的编辑器 VSCode 以及常用插件
git·vscode·后端·macos·开源·编辑器·github
亚林瓜子17 小时前
虚拟Python 环境构建器virtualenv安装(macOS版)
python·macos·virtualenv·pipx
瓜子三百克18 小时前
采用sherpa-onnx 实现 ios语音唤起的调研
macos·ios·cocoa
北漂强20 小时前
Mac---安装Navicat 16
macos
ElenaYu20 小时前
mac安装cast
python·macos·cast
爱笑的林羽1 天前
Mac M系列 安装 jadx-gui
前端·macos
筱宇***2 天前
Mac的web服务器
mysql·nginx·macos·php
Lucky me.2 天前
关于mac配置hdc(鸿蒙)
macos·华为·harmonyos
安和昂2 天前
【iOS】Tagged Pointer
macos·ios·cocoa