modifying a Plist from command line on Mac using Defaults

前端 未结 4 1282
离开以前
离开以前 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:20

    Use the -array-add value type:

    defaults write /path/to/plist/file "URL Types" -array-add '{"URL Identifier" = "com.myapp.2"; "URL Schemes" = { "two"; }; }'
    

提交回复
热议问题