Monday, 9 July, 2007

Mac OS X Tips : Trouble shooting - Launch Services

The Finder, and the command line based 'open' command, both use Launch Services to associate documents with applications. The Finder also uses this information to associate icons with documents.

The 'lsregister' command can be launched from the command-line, and gives scope for manual maintenance of the Launch Services database.

Problems involving incorrect icons or documents failing to open (with the proper application) can be solved using 'lsregister'

$ /System/Library/Frameworks/

(all on one line)

lsregister: [OPTIONS] [-domain { system | local | user | network }]... [path]...

Search the paths for application bundles and add each found item to the Launch Services database. For domain specifications, ask CF for the list of application locations in the given domain(s).

-kill Reset the global Launch Services database before doing anything else
-lint Print information about plist errors while registering bundles
-convert Register apps found in older LS database files
-load Load the LaunchServices service plugin if it's not already loaded.
-lazy n Sleep for n seconds before registering apps if the local cache is aleady populated.
-r Recursively register directory contents, do not recurse into packages or invisible directories.
-R Recursively register directory contents, including the contents of packages and invisible directories.
-f force-update registration info even if mod date is unchanged
-v Display progress information.
-dump Display full database contents after registration.
-h Display this help.

Issuing the command:

...the/long/path/lsregister -kill -r -domain system -domain local -domain user

will repair the Launch Services database.


No comments: