macOS 權限(TCC)
macOS permission grants are fragile. macOS 的權限授予機制相當脆弱。TCC 會將權限授予與以下項目關聯: app’s code signature, bundle identifier, and on-disk path. If any of those change, macOS treats the app as new and may drop or hide prompts.穩定權限的需求
- 相同路徑:從固定位置執行應用程式(對於 OpenClaw,
dist/OpenClaw.app)。 - 相同套件識別碼:變更套件 ID 會建立新的權限身分。
- 已簽署的應用程式:未簽署或 ad-hoc 簽署的組建不會持久保存權限。
- 一致的簽章:使用真正的 Apple Development 或 Developer ID 憑證, 以確保在重新組建之間簽章保持穩定。
當提示消失時的復原檢查清單
- Quit the app.
- 在「系統設定」->「隱私權與安全性」中移除應用程式項目。
- 從相同路徑重新啟動應用程式並重新授與權限。
- 若提示仍未出現,使用
tccutil重設 TCC 項目後再試一次。 - 有些權限只有在完整重新啟動 macOS 後才會再次出現。
檔案與資料夾權限(桌面/文件/下載)
macOS may also gate Desktop, Documents, and Downloads for terminal/background processes. If file reads or directory listings hang, grant access to the same process context that performs file operations (for example Terminal/iTerm, LaunchAgent-launched app, or SSH process). 因應方式:若想避免逐資料夾授權,可將檔案移至 OpenClaw 工作區(~/.openclaw/workspace)。
If you are testing permissions, always sign with a real certificate. 如果您正在測試權限,請務必使用真實憑證進行簽章。Ad-hoc
builds are only acceptable for quick local runs where permissions do not matter.