Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

change xcrun developer path for Android Studio/IntelliJ

I'm using GIT and am trying to push my code and getting the following error when using the Terminal. I don't use XCode, I'm using Android Studio.

The command I tried using was:

git branch Networking

Error:

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

I am running on El Capitan Beta 4 update if that helps in any way.


Update: This also happens for IntelliJ users, and for MacOS Catalina update

like image 933
Stillie Avatar asked Jul 23 '15 06:07

Stillie


4 Answers

I ran into the same problem, however with svn. I found that by installing El Capitan, Xcode was "uninstalled". I reinstalled Xcode from the App Store and then reinstalled Xcode Command Line Tools via Terminal with

xcode-select --install

After installation, my /Library/Developer/CommandLineTools/usr/bin directory reappeared and svn started working again.

like image 57
Rob Avatar answered Nov 08 '22 20:11

Rob


Instead of installing xcode you can install git from here and change the path in android studio to /usr/local/git/bin/git as shown in the image below.

studio preferences

This way you save time and memory.

like image 21
Abhishek Nandi Avatar answered Nov 08 '22 21:11

Abhishek Nandi


Use /usr/local/git/bin/git as a path

like image 4
Jasur Shukurov Avatar answered Nov 08 '22 21:11

Jasur Shukurov


In my case, Git did not work after upgrading Mac OS X High Sierra.

Fortunately, the answer provided by @Rob still works for High Sierra, so there was no need for me to actually change the xcrun developer path and no need to install all of XCode

like image 1
Phileo99 Avatar answered Nov 08 '22 20:11

Phileo99