How can I find out if I have Xcode commandline tools installed?

P i picture P i · Jan 22, 2014 · Viewed 208.6k times · Source

I need to use gdb.

ps-MacBook-Air:AcoustoExport pi$ gdb
-bash: gdb: command not found

ps-MacBook-Air:AcoustoExport pi$ sudo find / -iname "*gdb*"
Password:
/usr/local/share/gdb
/usr/local/Cellar/isl/0.12.1/share/gdb
:

and:

ps-MacBook-Air:AcoustoExport pi$ ls -la /usr/local/share/gdb
lrwxr-xr-x   1 pi    admin   30 14 Jan 22:01 gdb -> ../Cellar/isl/0.12.1/share/gdb

Not quite sure what to make this, clearly it is something installed by homebrew. I don't know why it's there, I don't know whether I could use it instead. It isn't in the search path.

So I figure I need Xcode commandline tools.

Xcode is not currently available from the Software Update server

^ my current problem exactly. Comment on that question says "you can get this error if you have them already"

But how do I check whether I have them already?

Answer

crujzo picture crujzo · Nov 4, 2016
/usr/bin/xcodebuild -version

will give you the xcode version, run it via Terminal command