Tuesday, June 9, 2020

plutil Enhanced in Catalina

Dominik Wagner:

TIL: plutil in catalina also supports objc and swift as output format. So if you want to quickly convert a e.g. json to inline code format, plutil might be the thing for you.

Previously, plutil was mostly useful for validating propery lists and for converting between XML, binary, and JSON representations. Now it can also generate Objective-C and Swift literals. And there are new commands for inserting, replacing, removing, and extracting a value at a particular key path. This seems less powerful than PlistBuddy but with a more standard interface.

Previously:

Update (2021-01-12): Unfortunately, plutil will crash if you try to set the value of a dictionary key whose first character is a number.

1 Comment RSS · Twitter

The key path manipulation arguments have been supported for a long time. The man page wasn’t updated until recently.

Leave a Comment