Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I had serious problems from two versions of Xcode on the same machine. I removed all Xcode app instances & many other non-System 'xcode'-related files, then reinstalled the app (4.6.2), fixing my original problem. But xcodebuild and xcode-select are still not available, which I need to run PhoneGap for iOS. Within Xcode, the Preferences => Downloads => Command-line Tools item is marked "Installed", with no option to delete or re-install. I tried removing xcrun, but that didn't work. How do I fix this?

share|improve this question

2 Answers 2

Did you try xcode-select?

man xcode-select

or

xcode-select --switch /Applications/Xcode
share|improve this answer
    
Not available. I mistakenly removed it, and I didn't get it back when reinstalling command line tools. –  sierra Jun 11 '13 at 13:40

The command line tools are installed like other OS X packages, so you may need to delete the receipt file from the receipts database (which used to be trivial since you could delete the file from /Library/Receipts but now is more complicated and needs a short article on the receipts database).

Rather than mess with that, why not just download the stand alone installer and wait for a new version of Xcode to clean up your receipts database for you?

This URL is fairly open (even the search engines can index it) but you might need to make a free Safari or free Mac developer account to log in and get this package.

If this happened to me, I'd simply change my Time Machine to exclude system files and then install a new OS onto a spare volume. I'd make a junk admin user that I'll delete and use that user to install Xcode and the command line tools and then finally restore from Time Machine. As long as everything worked, I'd clone that to my main drive or repeat the wipe/reinstall process - whichever is easier for you to perform.

share|improve this answer
    
Forgot to mention that I tried that; xcodebuild still unavailable in standard executible dirs. There is one in Xcode.app/Contents/Developer/usr/bin/xcodebuild. –  sierra Jun 10 '13 at 17:05
    
xcrun will tweak your path if you have multiple toolsets installed. You could just mv those binaries into /usr/bin if you wanted a quick fix. Again with WWDC running as I type this, a new version of Xcode should drop within a day or two... –  bmike Jun 10 '13 at 17:10
    
Thanks. Are you suggesting copying all the files from that dir? –  sierra Jun 10 '13 at 17:25
    
Here's a paste of /usr/bin from a clean Mac with the latest command line tools. You can diff it with your listing (ls -la /usr/bin) cl.ly/PYyh to see what needs to be copied and what Apple left in the Xcode.app /Developer folder. –  bmike Jun 10 '13 at 17:51
    
No dice: $ xcodebuild dyld: Library not loaded: @rpath/DVTFoundation.framework/Versions/A/DVTFoundation Referenced from: /usr/bin/xcodebuild Reason: image not found Trace/BPT trap: 5 –  sierra Jun 11 '13 at 13:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.