17

I typically associate certain file types with certain editors and IDEs. You know R with RStudio, Java with JetBrains, and all the other goodies with Sublime Text.

But every time I install an Xcode update, Xcode takes over every code-related extension imaginable, and I have to associate my files manually.

Is there anyway to prevent Xcode from taking over my file associations?

  • 2
    ^^THIS. The best workaround I've found is to never install the sodding GUI. Use xcode-select --install in terminal – Mark_Anderson Feb 7 at 15:32
  • We might be able to edit xcode's Info.plist file to remove any CFBundleTypeExtensions that we don't want. (article) But it might get wiped every time xcode updates :/ Leaving as a comment in case this turns out useful but I haven't been able to try it yet. – mrgnw Apr 13 at 15:01
8

Absolutely there is!
Unfortunately because Xcode is installed through the Mac App Store, we are unable to control / prevent the change from occurring in the first place. The automated installation takes care of that for us.

How to Change the Default Programs
Luckily there is an easy fix to resolving the issue and reversing the change. The only caveat of which is the fact that this is done on an extension-based level.

  1. Go to any file whose extension you don't want to open with Xcode (e.g. my file.java).
  2. Right click on it, select Get Info (or CMD I).
  3. Under Open With, select your editor for that extension.
  4. Click Change All to make the change global across all files of this type.

I believe some IDEs or even individual Text editors will ask if you would like to associate them with the most common formats for software development - with Xcode that's a little less optional. Anyway, hope that helps, let me know if it did and how you make out. I'd be interested in following up with you on this.

| improve this answer | |
  • 2
    I already know that I can change the extensions manually... that's how I did it in the first place. I just don't want Xcode to be able to hijack my file associations on every update. – fny Mar 1 '18 at 4:13
  • 1
    @fny Were you able to make any progress on this? I feel that at this point my answer is the only way to resolve the extension hijacking so I am also keen to know if you have found alternative solution in the meantime. – ProGrammer Mar 9 '18 at 10:06
  • 1
    Nope haven't had time to figure anything out! – fny Mar 13 '18 at 0:46
  • OSX is broken.. thank you! – Adam F Feb 10 at 20:35
1

The best workaround I've found is to install the Xcode CLI and NEVER INSTALL the Xcode GUI. As OP says, the GUI/IDE aggressively accrues responsibilities and I never worked out how to stop it.

Use xcode-select --install in terminal to get the CLI. This solves Xcode dependency for (eg.) Homebrew and you can subsequently forget about Xcode.

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .