PLUTIL(1) General Commands Manual PLUTIL(1)

plutilproperty list utility

plutil [command_option] [other_options] file
...

plutil can be used to check the syntax of property list files, or convert a plist file from one format to another. Specifying - as an input file reads from stdin.

The first argument indicates the operation to perform, one of:

Show the usage information for the command and exit.
Print the property list in a human-readable fashion. The output format is not stable and not designed for machine parsing. The purpose of this command is to be able to easily read the contents of a plist file, no matter what format it is in.
Check the named property list files for syntax errors. This is the default command option if none is specified.
fmt
Convert the named file to the indicated format and write back to the file system. If the file can't be loaded due to invalid syntax, the operation fails. This is the only option to support objc swift formats.
objc -header
Converts the named file to Obj-C literal syntax and creates a .h file. Useful for first time conversions to literal syntax and only supported with the objc format.
keypath -type [value] [-append]
Insert a value into the property list before writing it out. value is required unless type is dictionary or array. If -append is specified, keypath is expected to reference an array and the value will be appended to the end of the array.
keypath -type value
Overwrite an existing value in the property list before writing it out.
keypath
Removes the value at keypath from the property list before writing it out.
keypath fmt [-expect expect_type]
Outputs the value at keypath in the property list as a new plist of type fmt. Optionally fails if -expect expect_type is used and the value at keypath does not match that type.
keypath [-expect expect_type]
Outputs the type of the value at keypath in the property list. Optionally fails if -expect expect_type is used and the value at keypath does not match that type.
fmt
Creates an empty plist of the specified fmt.

There are a few additional options:

--
Specifies that all further arguments are file names
When used with -extract using the raw format, will not print a terminating newline character. This aids use in shell interpolation.
Don't print anything on success.
For JSON, add whitespace and indentation to make the output more human-readable and sort the keys like -p, does.
path
Specify an alternate path name for the result of the -convert operation; this option is only useful with a single file to be converted. Specifying - as the path outputs to stdout.
extension
Specify an alternate extension for converted files, and the output file names are otherwise the same.

fmt is one of:

for version 1 of the XML plist format
for version 1 of the binary plist format
for the JSON format
to convert from plist to swift literal syntax
to convert from plist to Obj-C literal syntax
when used with -extract, will print the unencapsulated value at the keypath. See below. The result will be output to stdout unless -o is specified.

keypath is a key-value coding key path, with one extension: a numerical path component applied to an array will act on the object at that index in the array or insert it into the array if the numerical path component is the last one in the key path.

type is one of:

YES if passed "YES" or "true", otherwise NO
any valid 64 bit integer
any valid 64 bit float
UTF8 encoded string
date in XML property list format, not supported if outputting JSON
a base-64 encoded string
an XML property list, useful for inserting compound values
JSON fragment, useful for inserting compound values
An empty array, when used with -insert. Does not accept a value.
An empty dictionary, when used with -insert Does not accept a value.

value will be assigned to the keypath specified with the -insert or -replace flags.

With -extract keypath raw the value printed depends on its type.

Following are the possible expect_type values and how they will be printed when encountered with -extract keypath raw

the string "true" or "false"
the numeric value
the floating point value with no specific precision
the raw unescaped string, UTF8-encoded
the RFC3339-encoded string representation in UTC time zone
a base64-encoded string representation of the data
a number indicating the count of elements in the array
each key in the dictionary will be printed on a new line in alpha-sorted order
The above expect_type string is itself printed when -type keypath is used.

The plutil command exits 0 on success, and 1 on failure.

plist(5)

The plutil command obeys no one's rules but its own.

The plutil command first appeared in macOS 10.2.

The raw format type, -type command, -expect option, and -append option first appeared in macOS 12.

March 29, 2021 macOS