Property List (.plist) files form the architectural backbone of macOS configuration management, application bundling, LaunchAgents, LaunchDaemons, and system preference storage. In older operating systems, configuration was stored in plain-text XML plists. However, modern macOS versions frequently compile plists into compact, proprietary binary formats (bplist00) for high-speed serialization and storage efficiency. When system administrators, fleet engineers, or developers attempt to view or edit these binary files using standard text editors, they encounter garbled binary code. The native macOS command-line utility plutil provides comprehensive tools to validate syntax, convert between XML, binary, and JSON formats, and query or manipulate specific keys directly from Terminal.
Validating Property List Syntax with plutil -lint
Before deploying a LaunchAgent plist, editing application defaults, or modifying configuration profiles, validating syntax prevents launch failures and system errors:
plutil -lint ~/Library/LaunchAgents/com.example.service.plist
The utility parses the document against strict property list specifications:
- If the file is structurally sound, Terminal outputs:
...service.plist: OK. - If the plist contains syntax errors—such as unclosed XML tags, mismatched dictionary keys, or invalid type declarations—
plutilpinpoints the exact line number and parsing error description, saving hours of configuration troubleshooting.
Converting Between Binary, XML, and JSON Formats
plutil enables effortless bidirectional format conversion using the -convert parameter:
- Convert Binary to Human-Readable XML: To convert a binary plist into editable XML text:
You can now open and edit the file in any standard text editor like Nano, VS Code, or TextEdit.plutil -convert xml1 com.apple.finder.plist - Convert XML back to Optimized Binary: Once modifications are complete, compile the plist back into high-performance binary:
plutil -convert binary1 com.apple.finder.plist - Convert Property Lists to JSON: For modern devops pipelines and automated scripting,
plutilnatively serializes property lists directly into compliant JSON markup:
Theplutil -convert json -o - com.apple.finder.plist-o -flag routes the JSON output directly to standard output (stdout), allowing seamless piping into command-line JSON processors likejq.
Querying Specific Keys Using Keypath Navigation (-p and -extract)
Rather than dumping an entire multi-thousand-line configuration file, you can extract specific keys using keypaths:
- To pretty-print an entire plist in human-readable formatted text without altering the underlying file format on disk:
plutil -p /Library/Preferences/com.apple.TimeMachine.plist - To extract a specific dictionary key or array value, use
-extractwith a keypath:
Theplutil -extract "AutoBackup" raw /Library/Preferences/com.apple.TimeMachine.plistrawformat specifier returns the plain unadorned value (e.g.,1ortrue), ideal for consumption within shell scripts and automation workflows.
Modifying and Inserting Keys Directly via the Command Line
Modern versions of plutil support direct in-place key manipulation using the -replace and -insert flags:
plutil -replace "RunAtLoad" -bool true ~/Library/LaunchAgents/com.example.service.plist
Supported data types include -bool, -integer, -float, -string, -date, -data, -array, and -dictionary. This eliminates the need for cumbersome string replacements via sed or awk, ensuring that structural data types and binary encodings remain pristine.