Accessibility Permissions & TCC
Mumbli requires macOS Accessibility permission to:- Read the focused text field via
AXUIElementCopyAttributeValue(to inject text at the cursor) - Create CGEvent taps to listen for the Fn/Globe key
- Post CGEvent key events for the Cmd+V clipboard fallback
Why permissions break after rebuilding
macOS stores acsreq (code signing requirement) blob alongside the bundle ID in the TCC database. For ad-hoc signed apps (the default for local Xcode builds without a team), the Designated Requirement is based on the exact cdhash — which changes on every rebuild.
- The toggle in System Settings stays ON (matched by bundle ID)
- But the
csreqverification silently fails at runtime AXUIElementCopyAttributeValuereturns error-25211(kAXErrorCannotComplete)CGEventTapCreatereturns nilCGEventPostsilently drops events — no error, just nothing happens
Fixing during development
Option A: Reset TCC after each rebuild
Option B: Use a Development Team (recommended)
Set a Development Team in Xcode (Signing & Capabilities) so the app gets a stable signing identity that persists across rebuilds.Option C: Direct binary launch
After resetting TCC, launch the binary directly instead of via Finder/open:
Text injection: AX vs clipboard
Mumbli uses a two-tier injection strategy:| Method | How it works | When it’s used |
|---|---|---|
| Accessibility API | Sets kAXSelectedTextAttribute on the focused element | Most GUI apps (VS Code, browsers, text editors) |
| Clipboard fallback | Copies text to pasteboard + simulates Cmd+V | Terminal emulators, apps where AX writes silently fail |
Terminal apps (Terminal.app, CMuX, iTerm2, etc.)
Terminal emulators exposeAXTextArea elements where the AX API returns .success but the write is silently ignored (terminals read from stdin, not the accessibility layer). Mumbli detects this by:
- Checking
AXUIElementIsAttributeSettable(kAXSelectedTextAttribute)at capture time - If not settable, skipping AX and going straight to clipboard paste
- If settable, verifying the write by reading the value back
Diagnostics
Check the log at:CGEvent tap created successfully— permissions workingCGEvent tap failed— permissions not grantedNo focused element (error: -25211)— TCC verification failedSkipping AX injection — selectedText not settable— correct terminal behaviorSet selected text returned success but verification failed— AX false positive caught