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've got Xcode 4.0.2 installed in /Developer, and the Xcode 4.2 beta in /XcodeBeta. My problem is that the .xcodeproj file type is now associated with Xcode 4.2 and I can't change it to Xcode 4.0.2.

I've tried the usual thing of doing Get Info on an .xcodeproj file, selecting Xcode (4.0.2) in the Open with: drop down then clicking Change All..., but at that point the version of Xcode selected in the Open with: dropdown just flips back to Xcode 4.2 and the file type association remains with Xcode 4.2.

If I rebuild my Launch Services DB using lsregister -kill -domain local -domain system -domain user this removes any reference to /XcodeBeta/Applications/Xcode.app in the Launch Services DB (as reported by lsregister -dump), but the next time I start up that version of Xcode it re-registers itself with Launch Services and re-hijacks all my file associations. It's driving me potty!!

(Incidentally, this also affects other file types associated with Xcode, e.g. .plist, but it's .xcodeproj that's really causing my pain.)

Any ideas?

share|improve this question
    
@VxJasonxV thanks for the edit, but the title was correct to begin with: the Xcode beta I'm using is 4.2, not 4.0.2 per your correction. –  Simon Whitaker Jun 24 '11 at 7:54
    
Erp. Sorry about that. I know 4.0.2 isn't in beta. Mental fluke. (And not the only one I made last night either... yuck.) –  Jason Salaz Jun 24 '11 at 17:15

2 Answers 2

up vote 2 down vote accepted
+50

Use RCDefaultApp prefpane. You can get it from http://www.rubicode.com/Software/RCDefaultApp/

Open it, select UTIs and scroll down to com.apple.xcode.project. RCDefaultApp screenshot

On the right you can change which filetype is associated to which application or disable the association completely.


Edit: another alternative is Magic Launch, which allows the same kind of file association overrides.

Open it, drag an Xcode project file into the pane on the left, set the Default Application on the right to the appropriate version of Xcode.

Magic Launch screenshot

share|improve this answer
    
This is correct, but the problem is that the bundle com.apple.xcode.project is also used by the other Xcode, hence the conflict. –  Martín Marconcini Jun 27 '11 at 11:12
    
I don't get that point. Why is this a problem? Isn't this exactly what he wanted? To change the associated application? A UTI is always only associated to one application, hence the name. And this prefpane allows you to change it. –  Max Ried Jun 27 '11 at 14:08
1  
Many thanks, I think this is (sadly!) the only way forward. I actually ended up using Magic Launch, a slightly less complex alternative to RCDefaultApp. Since you created your answer as a community wiki I've gone ahead and appended details of Magic Launch to it for the benefit of others. Enjoy your 50 reputation points! :) –  Simon Whitaker Jun 27 '11 at 15:14

This is caused by Xcode using the same bundle identifier across versions. You could try to rename the Xcode.app of the beta to something like XcodeBeta.app. This should make LaunchServices think that XcodeBeta.app is in fact older and let you open the .xcodeproj files with the other version. It's not a real solution, but this is as far as I can tell the only way (short of changing Xcode's bundle identifier, of course).

share|improve this answer

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.