Viewing and Editing Property Lists
There are two ways you can view and edit the contents of an application’s preferences file:
With the Property List Editor (
/Developer/Applications/Utilities)From the command line, using the
defaultscommand
The Property List Editor is available on your system only after
installing the Xcode Tools; however, the defaults
command is available with the base installation of Mac OS
X, and doesn’t require you to install any additional
software.
Viewing is one thing, but knowing what you can enter into a
plist file requires a bit of investigative work.
An application asserts its domain through the
CFBundleIdentifier key in its internal
Info.plist file, which is stored in an
application’s /Contents
directory. For example, the Info.plist
file for the Dock can be found in
/System/Library/CoreServices/Dock.app/Contents.
The preferences available to an application are defined via the
CFBundleExecutable key in the
Info.plist file. Typically, the string for
CFBundleExecutable is the short name for the
application (e.g., Dock). This executable can be found in an
application’s /Contents/MacOS
directory; e.g., the Dock executable is located in
/System/Library/CoreServices/Dock.app/Contents/MacOS.
To see a listing of available keys and strings for an application,
use the strings command in the Terminal,
followed by the path to the application’s short name
as defined by CFBundleExecutable:
$ strings /System/Library/CoreServices/Dock.app/Contents/MacOS/Dock Unfortunately, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access