ký mac (bản build debug)
Ứng dụng này thường được build từscripts/package-mac-app.sh, script hiện nay:
- đặt một bundle identifier debug ổn định:
ai.openclaw.mac.debug - ghi Info.plist với bundle id đó (có thể ghi đè qua
BUNDLE_ID=...) - calls
scripts/codesign-mac-app.shto sign the main binary and app bundle so macOS treats each rebuild as the same signed bundle and keeps TCC permissions (notifications, accessibility, screen recording, mic, speech). mặc định dùngCODESIGN_TIMESTAMP=auto; nó bật trusted timestamps cho chữ ký Developer ID. - uses
CODESIGN_TIMESTAMP=autoby default; it enables trusted timestamps for Developer ID signatures. ĐặtCODESIGN_TIMESTAMP=offđể bỏ qua việc đóng dấu thời gian (các bản build debug ngoại tuyến). - chèn metadata build vào Info.plist:
OpenClawBuildTimestamp(UTC) vàOpenClawGitCommit(hash ngắn) để bảng About có thể hiển thị build, git, và kênh debug/release. - Đóng gói yêu cầu Node 22+: script chạy các bản build TS và build Control UI.
- Thêm
export SIGN_IDENTITY="Apple Development: Your Name (TEAMID)"(hoặc chứng chỉ Developer ID Application của bạn) vào shell rc để luôn ký bằng chứng chỉ của bạn. Ký ad-hoc yêu cầu opt-in rõ ràng quaALLOW_ADHOC_SIGNING=1hoặcSIGN_IDENTITY="-"(không khuyến nghị cho việc kiểm thử quyền). Ad-hoc signing requires explicit opt-in viaALLOW_ADHOC_SIGNING=1orSIGN_IDENTITY="-"(not recommended for permission testing). - runs a Team ID audit after signing and fails if any Mach-O inside the app bundle is signed by a different Team ID. Set
SKIP_TEAM_ID_CHECK=1to bypass.
Cách dùng
Lưu ý về ký ad-hoc
Điều này là cần thiết để tránh crash khi ứng dụng cố tải các framework nhúng (như Sparkle) không dùng chung Team ID. This is necessary to prevent crashes when the app attempts to load embedded frameworks (like Sparkle) that do not share the same Team ID. Ad-hoc signatures also break TCC permission persistence; see macOS permissions for recovery steps.Metadata build cho About
package-mac-app.sh đóng dấu bundle với:
OpenClawBuildTimestamp: ISO8601 UTC tại thời điểm đóng góiOpenClawGitCommit: hash git ngắn (hoặcunknownnếu không có)
#if DEBUG). Run the packager to refresh these values after code changes.
Lý do
TCC permissions are tied to the bundle identifier and code signature. Unsigned debug builds with changing UUIDs were causing macOS to forget grants after each rebuild. Signing the binaries (ad‑hoc by default) and keeping a fixed bundle id/path (dist/OpenClaw.app) preserves the grants between builds, matching the VibeTunnel approach.