xcode-select: error: invalid developer directory ‘path/to/Xcode.app’
1、输入命令
sudo xcode-select --switch path/to/Xcode.app
报错:
xcode-select: error: invalid developer directory ‘path/to/Xcode.app’
2:输入xcode-select安装命令
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
没有错误