xcodeselect: error: invalid developer directorypath/to/Xcode.app

1、输入命令

sudo xcode-select --switch path/to/Xcode.app

报错
xcodeselect: error: invalid developer directorypath/to/Xcode.app

2:输入xcodeselect安装命令

sudo xcode-select --install

输出提示已经安装

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

3:输入命令查看路径

xcode-select -print-path

输出
/Applications/Xcode.app/Contents/Developer

4:替换XCode路径

sudo xcode-select --switch /Applications/Xcode.app

输出错误,因为Xcode之前已经卸载
xcode-select: error: invalid developer directory ‘/Applications/Xcode.app’

5:安装XCode

在这里插入图片描述

6 成功

sudo xcode-select --switch /Applications/Xcode.app

没有错误

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注