如果數組對應的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查看用法,注意是用:來區(qū)分元素之間的關系,比如刪除數組的第一個元素:
/usr/libexec/PlistBuddy -c "Delete :com.apple.developer.icloud-container-environment:0" t_entitle.plist