tags:

views:

58

answers:

2

I would like to be able to build test applications (e.g. the nightly Minefield/Firefox) without Launch Services deciding that they're the best way to open their assigned file types.

Is there a way to hide my ~/src directory from Launch Services, so that Finder won't register applications in that folder?

+1  A: 

I don't know of a way to do that hiding, but you can change the bundle ID of your development apps so that they don't get treated as the preferred app for that content type/URI scheme by LaunchServices.

Graham Lee
+1  A: 

and for Firefox specifically, the answer is: if OS X finds multiple applications that can handle an URL scheme, it will use the app with the highest version number. So, to fake out OS X, you can edit mozilla-central/browser/app/macbuild/Contents/Info.plist.in, and change the CFBundleShortVersionString from

    <string>%APP_VERSION%</string>

to

    <string>0.%APP_VERSION%</string>

This way, OS X will think the app is, say, version 0.3.2apre1, and it'll prefer the "real" version of Firefox.

A more general solution might be possible. OS X will prefer apps on a local volume to apps on a remote volume, and among local apps, it'll prefer those on the boot volume. So it might be possible to do some type of loopback mount, and keep your source code on a looped-back "volume", which again will lower its priority.

How OS X decides which app to launch for a given document or URL:

Launch Services Programming Guide: Preferred Applications

Jay Levitt