🍎 macOS 專項清理

macOS 上的 OpenClaw 可能涉及桌面應用、launchd 服務和 Homebrew 安裝,這裡逐一處理。

刪除桌面應用

如果你安裝了 OpenClaw 的 macOS 桌面版:

rm -rf /Applications/OpenClaw.app

也可以直接在 Finder 中把應用拖到廢紙簍。

清理 launchd 服務

這是 macOS 上最容易被忽略的部分。當你刪掉了 CLI,但發現背景網關服務還在運行(甚至重啟後又自動啟動),就需要手動清理 launchd:

# 停止並移除開機啟動項
launchctl bootout gui/$UID/ai.openclaw.gateway

# 刪除 plist 設定檔
rm -f ~/Library/LaunchAgents/ai.openclaw.gateway.plist
⚠️ 由於 OpenClaw 經歷過多次改名(Clawdbot → Moltbot → OpenClaw),服務名稱可能不一樣。建議運行以下命令檢查實際的 plist 檔案名:
ls ~/Library/LaunchAgents/ | grep -iE "openclaw|clawdbot|moltbot|gateway"

Homebrew 安裝的清理

如果是通過 Homebrew 安裝的:

# CLI 版本
brew uninstall openclaw-cli

# 帶 GUI 的 cask 版本
brew uninstall --cask openclaw

清理殘留目錄

# 狀態和設定目錄
rm -rf ~/.openclaw
rm -rf ~/.openclaw-*

# 檢查 Application Support(某些版本可能使用)
rm -rf ~/Library/Application\ Support/OpenClaw