A Useful Mac OS X Terminal Utility

PlistBuddy is a useful utility located in /usr/libexec that makes it easy to read and modify values inside of plists.

Usage: PlistBuddy [-cxh]
-c "" execute command, otherwise run in interactive mode
-x output will be in the form of an xml plist where appropriate
-h print the complete help info, with command guide

Command Format:
Help - Prints this information
Exit - Exits the program, changes are not saved to the file
Save - Saves the current changes to the file
Revert - Reloads the last saved version of the file
Clear [] - Clears out all existing entries, and creates root of Type
Print [] - Prints value of Entry. Otherwise, prints file
Set - Sets the value at Entry to Value
Add [] - Adds Entry to the plist, with value Value
Copy - Copies the EntrySrc property to EntryDst
Delete - Deletes Entry from the plist
Merge [] - Adds the contents of file.plist to Entry
Import - Creates or sets Entry the contents of file

Entry Format:
Entries consist of property key names delimited by colons. Array items
are specified by a zero-based integer index. Examples:
:CFBundleShortVersionString
:CFBundleDocumentTypes:2:CFBundleTypeExtensions

Types:
string
array
dict
bool
real
integer
date
data

Examples:
Set :CFBundleIdentifier com.apple.plistbuddy
Sets the CFBundleIdentifier property to com.apple.plistbuddy
Add :CFBundleGetInfoString string "App version 1.0.1"
Adds the CFBundleGetInfoString property to the plist
Add :CFBundleDocumentTypes: dict
Adds a new item of type dict to the CFBundleDocumentTypes array
Add :CFBundleDocumentTypes:0 dict
Adds the new item to the beginning of the array
Delete :CFBundleDocumentTypes:0 dict
Deletes the FIRST item in the array
Delete :CFBundleDocumentTypes
Deletes the ENTIRE CFBundleDocumentTypes array