How to manually edit defaults plist files in Mavericks

The new caching of preference settings in OS X Mavericks may frustrate some approaches to manual adjustment of program settings.

Topher Kessler MacFixIt Editor
Topher, an avid Mac user for the past 15 years, has been a contributing author to MacFixIt since the spring of 2008. One of his passions is troubleshooting Mac problems and making the best use of Macs and Apple hardware at home and in the workplace.
Topher Kessler
2 min read

The main preferences and settings-storage system in OS X is the "defaults," which saves values in binary- or ascii-encoded XML property lists. These are commonly seen in the user account's "Preferences" folder, but they exist in other locations and for other purposes in the OS.

The defaults for programs and system services are usually modified from within the program or OS settings panel, but common practice is to modify them by hand and then reload the relevant service or program to invoke the change. This can be done for standard settings, but is also useful for enabling hidden settings that Apple has implemented but provides no official setting for, such as moving the Dock to the corner of the display edge instead of being centered.

This type of setting can be invoked simply by running the relevant defaults command in Terminal to write it, followed by reloading the running program (like with the Dock). However, many defaults settings can be deeply nested structures that are too complex to create and manage using the standard defaults command.

In these cases, editing the relevant plist file manually using a text editor is often done. In earlier version of the OS, this works fine and the settings load when you relaunch the program, but if you try this in OS X Mavericks, the altered setting may not work.

The reason for this is that Mavericks now caches the defaults settings, instead of loading them directly from disk. This change offers a faster and more reliable means of managing settings by programs, but it also means that manual edits using text editors will not take immediate effect, which can can frustrate those who might be trying to make such changes on their system.

However, you may notice that using the defaults command itself will result in settings being immediately used, as it will properly cache the settings in addition to writing them to disk.

Even though those using text editors may be frustrated by the changes in Mavericks, since the defaults command itself will properly cache the preferences file, you can use it in conjunction with a text editor to implement a complex changes to a preference file. To do this, after you have saved your changes in the text editor, simply run the defaults read command on the plist file to list its contents.

For example, if you would like to change the Dock's position setting using a text editor, then you can open it and modify the "pinning" and "orientation" keys, and then save the changes. Next, you can run either of the following two commands to read out the Dock's plist file and re-cache them. Do this before relaunching the Dock, and the settings will be properly implemented and used when the program loads:

defaults read ~/Library/Preferences/com.apple.dock
defaults read com.apple.dock

Questions? Comments? Have a fix? Post them below or e-mail us!
Be sure to check us out on Twitter and the CNET Mac forums.