Invalid active developer path error after upgradin

2020-05-16 13:38发布

I ran into this error trying to push to git, when I typed git init.

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

I tried the following solutions.

xcode-select —install
sudo xcode-select -switch
sudo xcode-select —install
brew doctor
brew update
brew upgrade
brew cleanup

标签: xcode git
5条回答
放荡不羁爱自由
2楼-- · 2020-05-16 13:53

1)

try typing in "xcode-select -print-path" and see if the path you see is the path you're expecting for your current Xcode version.

2)

If you go to:

https://developer.apple.com/downloads/

(you'll need to sign in with your Apple Developer account)

Once there, you'll see links for "Command Line Tools". It sounds like you need to install MacOS 10.11 Command Line Tools for Xcode 7.

查看更多
The star\"
3楼-- · 2020-05-16 13:53

Try:

sudo xcode-select -r

in this way it unsets any user-specified developer directory, so that the developer directory will be found via the default search mechanism.

查看更多
够拽才男人
4楼-- · 2020-05-16 13:55

If you have Catalina and Xcode 11 and you have this problem, then go to Xcode Preferences and select Location tab, check that the Command Line tool dropdown has Xcode 11.0 selected. If Xcode 11 is not there then you need to download and install Command-line tools for Xcode 11 here (choose the correct Beta)

https://developer.apple.com/download/more/?=command%20line%20tools

查看更多
走好不送
5楼-- · 2020-05-16 13:57

This is all you need to do:

$ xcode-select --install
查看更多
Summer. ? 凉城
6楼-- · 2020-05-16 14:05

You can select command line tools from the XCode Preferences shown in the screenshot below.

You will be prompted for password.

enter image description here

查看更多
登录 后发表回答