How do I use llvm-profdata in Mac OS X Yosemite? I have a simple question: how do I use the llvm-profdata binary provided by XCode's Command Line Tools in the terminal?

I have installed the Command Line Tools and could see the binary in /Library/Developer/CommandLineTools/usr/bin/, like this:

$ ls /Library/Developer/CommandLineTools/usr/bin/ | grep llvm
llvm-cov
llvm-profdata


I know I could make it work by adding the path to /etc/paths, but I'm not sure what other side effect will occur if I do that.

For reference, here's my current /etc/paths:

$ cat /etc/paths
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin


I also have homebrew installed, if that matters.
You need to use the xcrun tool which will be in your path.

$ xcrun llvm-profdata &lt;args&gt;


The xcrun tool will execute the tool from the currently selected developer tools installation.

If you have Xcode installed you can select which developer tools are used with xcode-select. For example, if you have a beta version installed you can use that version of the command line tools with:

$ sudo xcode-select -s "/Applications/Xcode-beta.app"


and switch back with

$ sudo xcode-select -s "/Applications/Xcode.app"