AMAZINGINDEX.COM 日报快照
53.5
VOL. 2025.08
2025.08.21
← 返回 2025.08.21 日报
日报快照 · Daily Snapshot
NO. 013

macOS 27 废弃 hdiutil 命令

#ARTICLE HackerNews 2025.08.21
推荐指数 56.0 NO. 013 · 2025.08.21
发布2026/08/22Score183Comments81

苹果在 macOS 27 Golden Gate 中正式弃用沿用 20 余年的磁盘镜像工具 hdiutil,全面迁移至 diskutil image。CI/CD 流水线、开发者脚本中大量依赖 hdiutil 的自动化操作需要重写,且部分参数如 -puppetstrings 已被移除。

这个改动波及面比表面大得多。hdiutil 是 macOS 自动化生态的隐形基础设施,从 Homebrew 安装包到 Xcode 构建脚本再到安全研究者的取证工具链,底层都调用了它。diskutil image 虽然功能覆盖大部分场景,但 -puppetstrings 的消失意味着需要机器解析进度的流水线必须重写交互逻辑。

更隐蔽的风险是 ASIF 格式仅限 diskutil image 支持,如果你维护着跨版本 macOS 的镜像文件,现在就要做格式兼容性测试。建议趁 beta 期用 otool 和 dtrace 扫一遍现有脚本里 hdiutil 的调用点,优先处理无人值守场景。

意见分歧 57 条评论

核心争论:苹果弃用命令行工具是渐进迁移还是习惯性破坏向后兼容

jstsch

Was the error visible somewhere through Console.app? This is a major annoyance for me with Cocoa/AppKit apps that basically have terminal usage secondary.

nrabulinski

Given xip has been deprecated for a long time now, yet still is the format Xcode is distributed in, I highly doubt hidutil will ever disappear from macOS. Apple just won’t really update it anymore, just like they haven’t changed xip (not like hidutil has seen any significant changes, but still)

bbatsell

Agreed. seatbelt/sandbox-exec has been “deprecated” for many, many years yet it still underlies all of the system’s sandboxing and Claude et al. use it for their own sandboxes. (And so do I — writing seatbelt rules is the only chance I get to write lisp-flavored anything these days.)

替代方案: diskutilxiplaunchctlWindows LTSCLinuxDocker
查看原文 →