20

i recently deleted xcode 6 beta 3 and installed xcode 6 beta 6

when i entered gitpush in the terminal this happened

xcrun: error: active developer path ("/Applications/Xcode6-Beta3.app/Contents/Developer") does not exist, use xcode-select --switch path/to/Xcode.app to specify the Xcode that you wish to use for command line developer tools (or see man xcode-select)

user02620
  • 311
  • 1
  • 2
  • 6
  • The message would suggest you should do something like `xcode-select --switch /Applications/Xcode6-Beta6.app`. Have you tried that? – John Flatness Aug 28 '14 at 02:53
  • If you just upgraded to mojave and got this, see https://apple.stackexchange.com/questions/254380/macos-mojave-invalid-active-developer-path – rogerdpack Oct 24 '18 at 20:46

4 Answers4

35

Try pasting this in the terminal:

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

It will update the path, for the new Xcode name.

Another alternative is just changing the app name back to Xcode, this, of course, considering you don't have the current one installed.

vyudi
  • 798
  • 2
  • 9
  • 22
21

Also, to remove dependency from XCode app you can manually install Command line developer tools and use the following command to update developer path:

sudo xcode-select -switch /
TBA
  • 253
  • 1
  • 8
  • This helped me a lot as most other solutions I found were dependent on xcode still being on the system. I wanted to do it without xcode – Lezz Apr 07 '16 at 21:00
  • 1
    Recent update to El Capitan, never had XCode installed, executing this gave me: `xcode-select: error: invalid developer directory '/'` – Zayne S Halsall Sep 12 '16 at 09:32
  • 1
    Update: running `brew doctor` multiple times helped - had to add _/usr/local/sbin_ back to bash profile, had to rerun `xcode-select --install`. brew pointed out that El Capitan upgrade is known to bork this. :) All working again. – Zayne S Halsall Sep 12 '16 at 09:56
  • This Solution helped me solve my problem for using git without Xcode in the system. – user2508975 Sep 27 '17 at 07:43
14

Open xcode and navigate to preferences...

enter image description here

Select Location of xcode from command line tools.

enter image description here After that perform command from terminal.

Amit Jagesha シ
  • 1,048
  • 12
  • 19
7

Even i also faced the same problem after updating my XCode to 6.3

Resolved my problem by Updating Command line tools

$ sudo xcode-select -switch /