I'm having trouble direction info from plutil. I want to check if a .plist contains the key CFBundleShortVersionString. I don't think plutil has any option to test for if a key exists so I thought I would just plutil -show file.plist >file.txt
but that just plain doesn't work. :/ So I tried to direct the plist file from stdout to file with the dump option plutil -dump file.plist >file.txt
with no luck. :/ I also tried directing the stdout to stderr and stderr and stdout to file. Nothing worked. How do I do this?
DESCRIPTION. 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: -help.
plutil is a program that can convert . plist files between a binary version and an XML version. Currently, there are two versions of this utility.
Oneliner which doesn't depend on extra utility to install:
plutil -extract CFBundleShortVersionString xml1 -o - ./Info.plist | sed -n "s/.*<string>\(.*\)<\/string>.*/\1/p"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With