Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Editing plist file using shell script

Tags:

I have used pkgbuild to create a default Component Property List file. The file looks like:

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-     1.0.dtd"> <plist version="1.0"> <array>     <dict>         <key>BundleHasStrictIdentifier</key>         <true/>         <key>BundleIsRelocatable</key>         <true/>         <key>BundleIsVersionChecked</key>         <true/>         <key>BundleOverwriteAction</key>         <string>upgrade</string>         <key>RootRelativeBundlePath</key>         <string>MyApp.app</string>     </dict> </array> </plist> 

I want to modify this file by using shell script. I tried using defaults write but it didn't do anything.

What is the way to do it?(For example: I want to set BundleIsRelocatable to false)

like image 567
user2653062 Avatar asked Oct 05 '14 10:10

user2653062


People also ask

How do I edit plist on Mac?

plist file. If you need to edit these items, Control-click (or right-click) Info. plist in the sidebar and select Edit Manually. This allows you to add or edit items in raw XML format.

What is a .plist file?

The term “plist” is actually short for Info. plist or Information property list file. The plist is a special file that configures your mobile app, telling it how to run. Every iOS app uses an Info.


1 Answers

Also:

plutil -replace BundleIsRelocatable -bool false plistfilename.plist 
like image 166
jm666 Avatar answered Oct 14 '22 07:10

jm666