Apple - Changing Info.plist values via terminal
You can use defaults
or plutil
command line tools.
For defaults
it looks like this:
defaults write /absolute/path/to/Info.plist CFBundleExecutable -string <Executable>
For plutil
:
plutil -insert CFBundleExecutable -string <Executable> Info.plist
Value after -insert
is a key path separated by .
. For example
plutil -insert CFBundleDocumentTypes.0.CFBundleTypeExtensions.1 -string "scss" /Applications/Safari.app/Contents/Info.plist
will insert "scss" string deep in the path. Numbers after .
are for arrays (they are starting with 0
).
GET Value - supply raw key
/usr/libexec/PlistBuddy -c "Print CFBundleExecutable" Info.plist
SET Value - supply raw key and value
/usr/libexec/PlistBuddy -c "Set CFBundleExecutable <Executable>" Info.plist