- 在这里下载 xcode command line tools
https://developer.apple.com/download/all/?q=Command%20Line%20Tools%20for%20Xcode - 挂载dmg
hdiutil attach Command_Line_Tools_for_Xcode_15.3.dmg
- 安装pkg包
`sudo installer -package /Volumes/Command\ Line\ Developer\ Tools/Command\ Line\ Tools.pkg -target /“ - 卸载dmg
hdiutil detach /Volumes/Command\ Line\ Developer\ Tools