macOS 常用系統設置命令

macOS 系統設置除了打開「系統偏好設定」進行設置之外,還有一部分系統設置只能採用執行命令操作來完成。本文主要介紹常用的採用命令對系統設置的操作。

  • 允許任何來源的軟件運行
1
sudo spctl --master-disable
  • 開啟 apt-X
1
sudo defaults write bluetoothaudiod "Enable AptX codec" -bool true
  • 關閉 apt-X
1
sudo defaults write bluetoothaudiod "Enable AAC codec" -bool true
  • 顯示隱藏文件(重啟 Finder 生效)
1
defaults write com.apple.finder AppleShowAllFiles -bool true
  • 調整鼠標捲動方向 系統偏好設定-滑鼠-取消勾選「捲動方向:自然」

  • 啟用次像素抗鋸齒渲染

1
defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO
  • 淺色字體平滑
1
defaults -currentHost write -globalDomain AppleFontSmoothing -int 1
  • 中等字體平滑
1
defaults -currentHost write -globalDomain AppleFontSmoothing -int 2
  • 重字體平滑
1
defaults -currentHost write -globalDomain AppleFontSmoothing -int 3
  • 沒有字體平滑
1
defaults -currentHost write -globalDomain AppleFontSmoothing -int 0
  • 查看字體渲染設置
1
2
defaults read -g CGFontRenderingFontSmoothingDisabled
defaults -currentHost read -globalDomain AppleFontSmoothing