To read a plist you can use:
defaults read /Library/Preferences/com.apple.CrashReporterand similarly to write a value to a plist
sudo defaults write /Library/Preferences/com.apple.CrashReporter SomeKey -bool TRUE sudo defaults write /Library/Preferences/com.apple.CrashReporter SomeKey -string "somevalue"and delete
sudo defaults delete /Library/Preferences/com.apple.CrashReporter SomeKeyYou can also use plutil to dump an XML version to stdout:
plutil -convert xml1 -o - filename.plistas well as convert between binary and XML formats. Xcode also ships with a plist editor (standalone prior to XCode 4, built-in since then).
And if that wasn't enough there's also PlistBuddy, here's an example command to print a particular key 'BluetoothVersionNumber':
/usr/local/bin/PlistBuddy -c Print:BluetoothVersionNumber /Library/Preferences/com.apple.Bluetooth.plist
2 comments:
"Xcode also ships with a plist editor."
Well, it did for Xcode < 4.3. There is no longer such a beast, which is why i started a search that landed me on your blog. Thank you, as i was otherwise coming up empty.
Thanks, first result on google for a reason!
Post a Comment