Can’t view a plist? Here’s what to do

NewTerminalIconXThe various plist files in OS X are structured settings files that are commonly used as preference files for the applications you run, but are also used for launch daemons and other system configuration settings. Generally you can modify the values of plists by opening them directly in a text editor; however, there are times when in attempting to open a plist you either get an error or just see gibberish on your screen.

An inability to open a plist file is usually from a lack of access permissions, which can be overcome by using administrative access to alter permissions on the file or authenticate a program to read the file. However, any garbled text when you open a plist is likely from the file having been encoded as a binary instead of being stored in plain text.

Binary plist files are smaller and quicker to access than their text-based counterparts, but still hold the same information in the same XML structure. If you encounter any of these, then there are a couple of ways you can read and modify the contents of the files. The easiest way is to simply get a text editor such as the free TextWrangler, that will read a binary plist file. Built-in options that can do this are the Terminal’s “defaults” and “plutil” utilities.

If your preferred text editor cannot read binary plist  files, then you can still edit them by first converting them to standard text, followed by converting them back to binary when you are done managing them. To do this, you simply need to use the “plutil” Terminal command in the following manner (note that you may need to prepend “sudo” for root access to the file):

plutil -convert xml1 /path/to/file.plist

When run, the file will be converted to XML, and can then be edited. When done, just re-run the command you used to convert it, but replace “xml1” with “binary1” and the file will be converted back to binary.

Leave a Reply