Anyone with a clue

Anyone with a clue and a desire to minimize maintenance costs of their OS X system either knows or will soon learn that thou shalt not install crap in /Applications/ unless it is completely unavoidable. There are a slew of good reasons to do this and I have ranted on said topic a number of times in the past.

Recently, the question was posed — If not /Applications, then where does Apple suggest we install applications?

The off the cuff answer is simple; make an Applications/ directory in your home account and stick the apps there. Works and works well. That Apple doesn’t automatically create that directory as a part of the default user template would seem to be an oversight on their part.

Of course, the next question: What are all the directories within which OS X looks for applications?

Good question. The Foundation provides API via which one can easily query for the set of paths upon which various searches are performed.

For Applications, the default complete set is:

  • ~/Applications
  • ~/Applications/Utilities
  • ~/Developer/Applications
  • ~/Applications/GrabBag
  • /Applications
  • /Applications/Utilities
  • /Developer/Applications
  • /Applications/GrabBag
  • /Network/Applications
  • /Network/Applications/Utilities
  • /Network/Developer/Applications
  • /Network/Applications/GrabBag

GrabBag? What the heck is that (turns out, it is where Demo applications go!)?? And what other interesting things can we deduce via the Foundation API?

For one, OS X considers /Developer to be like /Library. In particular, the Library search paths (in order) are:

  • ~/Library
  • ~/Developer
  • /Library
  • /Developer
  • /Network/Library
  • /Network/Developer
  • /System/Library
  • /Developer

Furthermore, the Documents directory is limited to just the user (~/Documents). There isn’t a concept of a shared documents directory.

On the other hand, Documentation directories can be found in multiple locations. It would seem that there should be Developer specific directories in this mix (like there are for Library).

  • ~/Library/Documentation
  • /Library/Documentation
  • /Network/Library/Documentation
  • /System/Library/Documentation

By default, Users are found in one of two places; /Users or /Network/Users. I wonder if that list is extended if the system is the client of an OS X Server based network (or otherwise integrated as a client into a directory services based system)?

In any case, there you have it — all the fun places that the system looks for things, by default. What this means is that, if there is a directory in /Developer that contains stuff found automatically by some random tool, you can likely create the same directory in ~/Developer and add, extend or override to your heart’s content.

Same goes for /System/Library/* and the myriad of contents within. Obviously, a lot of stuff will be hardwired to wherever it happens to live. But other things will not be– Input Managers, for example, can be dropped into the appropriately named directory in any of the directories in the Library search path. [bbum’s rants, code & references]

Comments are closed.