120

OMG, what I've done?

Couple of days ago, I tried using macport to install something, because I'm using Xcode 4.3 and the command-line tool hadn't been installed by the time, macport wouldn't work. So I followed some guide to get command-line tool installed, then I used following command:

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

which I think screwed everything except macport: now, in Xcode, even a simple single-view iOS project won't be compiled, it says "UIKit/UIKit.h not found".

Does anyone know how to correct this? I don't want to re-install the gigantic Xcode again, gotta do some iOS project tonight, help!

1 Answer 1

334

You should be pointing it towards the Developer directory, not the Xcode application bundle. Run this:

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

With recent versions of Xcode, you can go to XcodePreferences…Locations and pick one of the options for Command Line Tools to set the location.

Sign up to request clarification or add additional context in comments.

7 Comments

ON running the above command i get error : xcode-select: Error: Path "/Applications/Xcode.app/Contents/Developer" is not a directory
@VikasSingh + abhishek the path will differ based on where you have xcode installed. For example if your xcode is called "Xcode 5.0.app" then the path would be: /Applications/Xcode\ 5.0.app/Contents/Developer
With recent versions of Xcode, go to Xcode > Preferences… > Locations and pick one of the options for Command Line Tools to set the location.
@jim, maybe updating the answer with your last comment would be useful?
What hierarchical structure of the folder should be to fullfill the need of xcode-select?
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.