1

So theres my problem, according to someone when I key this in xcode-select -p, I should get /Applications/Xcode.app/Contents/Developer however what I get is this

enter image description here

I have the CommandLineTools installed /Library/Developer/CommandLineTools/usr/bin and I also tried changing paths and such but still no luck..

EDIT: Here is what happens when I key in the following commands into terminal enter image description here

EDIT 2 (Ken Thomases):

enter image description here

Edward Lim
  • 763
  • 9
  • 31
  • If you've installed the command line tools package correctly then `xcode-select` should be in `/usr/bin`. – Paul R Sep 23 '15 at 22:00
  • @PaulR: `xcode-select` isn't included with the CLI-tools afaik — it should show up `/usr/bin` after downloading/launching `Xcode`. – l'L'l Sep 23 '15 at 22:22
  • 1
    @l'L'l: oh, yes, you're probably right - it would need to be available regardless of whether the command line tools are installed - I guess the OP may need to re-install Xcode then. – Paul R Sep 23 '15 at 22:25
  • @EdwardLim: Check in `/usr/bin` and see if there's `xcode-select` present by using the command `ls -lat /usr/bin | grep xcode-select`. – l'L'l Sep 23 '15 at 22:28
  • @PaulR: It could be a path problem perhaps too. `Xcode 7.0` seems to be using [different locations](http://stackoverflow.com/a/32638880/499581) than previous versions for the toolchains. When I do `xcode-select -p` it returns: `/Applications/Xcode.app/Contents/Developer` – l'L'l Sep 23 '15 at 22:36
  • Hi guys thanks for all the information however i've never done anything like this before so just to be clear @l'L'l: when you said check in /usr/bin I typed ls -lat /usr/bin into terminal I get a huge list and using the ctrl + F i come to a conclusion that xcode-select is not there. Where do I go from here? – Edward Lim Sep 24 '15 at 01:37
  • @EdwardLim: I would recommend re-downloading [Xcode from the App Store](https://itunes.apple.com/us/app/xcode/id497799835?mt=12#), which might solve the issue. – l'L'l Sep 24 '15 at 01:45
  • @l'L'l: Unfortunately I have done that many times, 5 times to be exact.. – Edward Lim Sep 24 '15 at 01:47
  • @EdwardLim: In terminal try this command `which xcode-select`, and also `locate xcode-select` — reply back with the result. – l'L'l Sep 24 '15 at 01:49
  • @l'L'l: I posted a screenshot of what happens when I key in the commands you request as an edit to my original question – Edward Lim Sep 24 '15 at 01:59
  • @EdwardLim: One last thing to try `xcrun --find xcode-select`. If it comes up empty, then I'm not sure why exactly. Which version of `OS X` are you running, and I assume it's `Xcode 7.0`? – l'L'l Sep 24 '15 at 02:11
  • @l'L'l: Heres what I get when I try that: xcrun: error: unable to find utility "xcode-select", not a developer tool or in PATH – Edward Lim Sep 24 '15 at 02:13
  • @EdwardLim: Open `Xcode > Preferences > Locations >`, what does it say for Command Line Tools and the path underneath (eg. `/Applications/Xcode.app`)? – l'L'l Sep 24 '15 at 02:15
  • @l'L'l: When I attempt to do that Xcode just freezes and crashes – Edward Lim Sep 24 '15 at 02:18
  • @EdwardLim: Which version of `OS X` is are you running? It seems there are some issues. Also, when you re-download Xcode are you trashing the existing one? – l'L'l Sep 24 '15 at 02:20
  • @l'L'l: Im running the latest one OS X Yosemite 10.10.5 and if you mean trashing as in pulling up all the system files and trashing it then yes, i am – Edward Lim Sep 24 '15 at 02:34

2 Answers2

2

Say it like this:

$ xcrun xcode-select -p

This is the New Dispensation: all the tools are inside Xcode and are accessed through the single xcrun command.

matt
  • 515,959
  • 87
  • 875
  • 1,141
  • When i type that in i get this xcrun: error: unable to find utility "xcode-select", not a developer tool or in PATH – Edward Lim Sep 24 '15 at 02:10
  • Use the Command Line Tools pop-up menu in Xcode's Locations preference pane to make sure we are pointed at _this_ copy of Xcode (Xcode 7) and not the old one. – matt Sep 24 '15 at 02:53
  • When you click on the locations in Xcode does your xcode not freeze? Because for me that is what seems to be happening, is there another way I can point at the right copy through the terminal? – Edward Lim Sep 24 '15 at 03:13
1

xcode-select is not part of the Command Line Tools nor is it part of Xcode. It is part of the base OS install.

When I do xcrun --find xcode-select it shows that the real one is in /usr/bin. That's not a stub or trampoline that redirects to some other thing in Xcode or whatever. That's the real program. (Contrast with xcrun --find cc. There's a trampoline in /usr/bin, but that's not what's reported by the xcrun command.)

Then we determine what package installed /usr/bin/xcode-select:

$ pkgutil --file-info /usr/bin/xcode-select
volume: /
path: /usr/bin/xcode-select

pkgid: com.apple.pkg.Essentials
pkg-version: 10.10.0.1.1.1429034296
install-time: 1429044400
uid: 0
gid: 0
mode: 755

Note that package ID, "com.apple.pkg.Essentials". This is part of the base OS install. If it had been installed by that package but then replaced or updated by another package, pkgutil would have listed both/all packages.

So, if you don't have any /usr/bin/xcode-select, your system is damaged. You should use the restore partition to reinstall the OS.

Ken Thomases
  • 88,520
  • 7
  • 116
  • 154
  • So I added a screenshot of what happens when I key in pkgutil --file-info /usr/bin/xcode-select, is the output what you would expect? Also when i key in xcrun --find cc this is what i get /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc – Edward Lim Sep 24 '15 at 04:46
  • That output is normal, but that doesn't change what I said. `xcode-select` is installed as part of the OS. It is missing on your system. Unlike what others have said, this has nothing to do with installing Xcode or the Command Line Tools or anything else. Your system has been damaged since it was installed. The only solution is to reinstall the OS. (By the way, don't use screenshots to show the output of commands at the shell. Copy and paste text for textual information.) – Ken Thomases Sep 24 '15 at 15:27
  • You sir are absolutely right, thank you so much for your help.. You have no idea, I've been searching for a solution for a a couple days now and you just made my day a lot better! Thanks! – Edward Lim Sep 24 '15 at 16:38