mac signing (debug builds)
This app is usually built fromscripts/package-mac-app.sh, which now:
- sets a stable debug bundle identifier:
com.clawdbot.mac.debug - writes the Info.plist with that bundle id (override via
BUNDLE_ID=...) - calls
scripts/codesign-mac-app.shto sign the main binary, bundled CLI, and app bundle so macOS treats each rebuild as the same signed bundle and keeps TCC permissions (notifications, accessibility, screen recording, mic, speech). For stable permissions, use a real signing identity; ad-hoc is opt-in and fragile (seedocs/mac/permissions.md). - uses
CODESIGN_TIMESTAMP=autoby default; it enables trusted timestamps for Developer ID signatures. SetCODESIGN_TIMESTAMP=offto skip timestamping (offline debug builds). - inject build metadata into Info.plist:
ClawdbotBuildTimestamp(UTC) andClawdbotGitCommit(short hash) so the About pane can show build, git, and debug/release channel. - Packaging requires Bun: The embedded gateway relay is compiled using
bun. Ensure it is installed (curl -fsSL https://bun.sh/install | bash). - reads
SIGN_IDENTITYfrom the environment. Addexport SIGN_IDENTITY="Apple Development: Your Name (TEAMID)"(or your Developer ID Application cert) to your shell rc to always sign with your cert. Ad-hoc signing requires explicit opt-in viaALLOW_ADHOC_SIGNING=1orSIGN_IDENTITY="-"(not recommended for permission testing).
Usage
Ad-hoc Signing Note
When signing withSIGN_IDENTITY="-" (ad-hoc), the script automatically disables the Hardened Runtime (--options runtime). 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 docs/mac/permissions.md for recovery steps.
Build metadata for About
package-mac-app.sh stamps the bundle with:
ClawdbotBuildTimestamp: ISO8601 UTC at package timeClawdbotGitCommit: short git hash (orunknownif unavailable)
#if DEBUG). Run the packager to refresh these values after code changes.
Why
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/Clawdbot.app) preserves the grants between builds, matching the VibeTunnel approach.