modifying a Plist from command line on Mac using Defaults

前端 未结 4 1359
离开以前
离开以前 2021-01-30 17:57

Does any one know how to modify a Plist file from command line using defaults? Currently there are two Dictionaries under the URL types array; I n

4条回答
  •  感动是毒
    2021-01-30 18:30

    XML property lists can be viewed in a text editor directly as Lauri's answer above suggests.

    Binary property lists (found in many of Apple's own shipping applications) need to be converted to an XML property list format first.

    plutil may be used to do this, in either direction. Take care though as the property list is modified in place, so you make wish to make a copy of the property list first.

    plutil -convert xml1 binary-property-list-to-convert.plist
    

    And to convert it back to binary:

    plutil -convert binary1 XML-property-list-to-convert.plist
    

提交回复
热议问题