如果数组对应的key很简单,比如list:
plutil -remove list t_entitle.plist
这个就可以删除了,so easy;可是如果key不是那么简单的话,就会报奇怪的错
plutil -remove com.apple.developer.default-data-protection t_entitle.plist
Could not modify plist, error: No value to remove at key path com.apple.developer.default-data-protection
这个时候就能凸显PlistBuddy的好用之处了
/usr/libexec/PlistBuddy -c "Delete :com.apple.developer.associated-domains" t_entitle.plist
可以 /usr/libexec/PlistBuddy -help查看用法,注意是用:来区分元素之间的关系,比如删除数组的第一个元素:
/usr/libexec/PlistBuddy -c "Delete :com.apple.developer.icloud-container-environment:0" t_entitle.plist