Skip to content

Instantly share code, notes, and snippets.

@mrlnc
Created July 26, 2022 21:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrlnc/a2a37398b07b43f337a6f7579511c31b to your computer and use it in GitHub Desktop.
Save mrlnc/a2a37398b07b43f337a6f7579511c31b to your computer and use it in GitHub Desktop.
plutil extract to JSON

Trying to convert a plist file to JSON but plutil is giving you a hard time?

I want the CellBroadcast as JSON:

plutil -extract CellBroadcast json -o - test.plist

That fails despite it should not:

test.plist: invalid object in plist for destination format

The solution is to first extract to binary, then convert to JSON:

plutil -extract CellBroadcast binary1 -o - | plutil -convert json -o - -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment