用 plutil -p 在终端美美地打印 plist

把任意属性列表以可读的键值形式输出——不用 Xcode,也不必啃 XML。

macOSplist 配置文件plutil plist 转换检查低风险
运行 plutil -p ~/Library/Preferences/com.apple.TextEdit.plist 打印该应用偏好;换成任意 .plist 路径均可。

01命令

命令
$ plutil -p ~/Library/Preferences/com.apple.TextEdit.plist

02作用说明

plutil -p 以紧凑的人类可读格式(嵌套花括号、无 XML 标签)输出 plist,是检查应用偏好、LaunchAgent 任务定义或 defaults 导出备份最快的方式。与 plutil -convert 不同,它只读不写、绝不修改文件,而且可以直接读二进制 plist。

03风险

风险低风险
!注意: 官方明确说明该输出格式不适合机器解析——脚本里请用 plutil -convert json -o -;沙盒应用可能拒绝访问其容器内的 plist。

04撤销

✓无需撤销——该命令不会改变持久状态。

05来源

  • plutil - Property List Utility
    SS64 · technical · 2026-09-17
    依据: Documents the -p option which prints the property list in a human-readable form to the terminal.
  • plutil(1) man page
    Xcode Man Pages · technical · 2026-09-17
    依据: The plutil man page describes -p: print the property list in a human-readable fashion (output format not designed for machine parsing).

最后验证: 2026-09-19 · 分类: 开发者

06相关方案