Xcode – How to resolve “Error: No developer directory found at /Developer”

macosxcodexcodebuild

I just upgraded XCode to 4.3.1.
I'm using a script to build (and then deploy through Testflight) my app.
But I now receive this error:

Error: No developer directory found at /Developer. Run /usr/bin/xcode-select to update the developer directory path.

I've no /Developer dir in my machine: how can I fix it?

Best Answer

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer