How to Use the ‘plutil’ Command to Read and Edit Property Lists in macOS

The Problem with Modern Property Lists

As discussed in previous articles, macOS stores application preferences and system configurations in Property List (.plist) files, usually located in ~/Library/Preferences/.

In older versions of Mac OS X, these files were written in plain text XML. You could open them in TextEdit, change a value, and save them. However, to improve read/write performance, Apple transitioned the macOS architecture to use binary property lists. If you try to open a modern .plist file in a standard text editor, you will see a garbled mess of unreadable hexadecimal characters.

To safely read, edit, and convert these binary files from the command line, you must use the native macOS Property List Utility: plutil.

Viewing the Contents of a Binary .plist

If you just want to inspect the contents of a preference file without modifying it, you can tell plutil to read the binary file and output it to your terminal screen in a human-readable format (usually XML or JSON).

plutil -p ~/Library/Preferences/com.apple.dock.plist

The -p (print) flag tells the utility to format the output cleanly. This is incredibly useful for finding the exact name of a key you might want to modify later using the defaults command.

Converting Formats (Binary to XML)

If you prefer to edit the file using a graphical text editor (like VS Code or BBEdit), you must first convert the file from binary back into plain XML text.

plutil -convert xml1 ~/Library/Preferences/com.apple.dock.plist

The file is now a standard XML document. You can open it in any text editor, make your necessary changes, and save it.

To ensure maximum performance and system compatibility, you should convert it back to binary once your edits are finished:

plutil -convert binary1 ~/Library/Preferences/com.apple.dock.plist

Validating Syntax Before Deployment

If you are an IT administrator building custom .plist files to deploy across a fleet of Macs via MDM (Mobile Device Management), a single missed bracket or unescaped quote in your XML will break the profile entirely.

Before deploying a file, you should always use plutil to lint (check the syntax) of the document.

plutil -lint /path/to/your/custom_profile.plist
  • If the file is structurally sound, it will output: OK.
  • If there is an error, it will output a detailed error message indicating the exact line number where the XML is broken, saving you hours of frustrating deployment troubleshooting.

Editing Data Directly with plutil

While the defaults command is generally safer for modifying standard user preferences, plutil can also be used to write data directly into a .plist file. This is often necessary when editing complex nested arrays or dictionaries that the simpler defaults command struggles to parse.

To change a simple string value directly using plutil:

plutil -replace "KeyName" -string "NewValue" /path/to/file.plist

To add a new key that didn’t exist before:

plutil -insert "NewKey" -bool YES /path/to/file.plist

Conclusion

While the defaults command remains the best tool for simple preference toggles, plutil is the foundational utility for deep structural manipulation of the macOS configuration architecture. Whether converting binary files for text editing or linting XML profiles for enterprise deployment, plutil ensures your property lists are perfectly formatted and syntactically flawless.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.