From 878643b90344efa56902b01e75623c3738cd0921 Mon Sep 17 00:00:00 2001 From: Minit Date: Fri, 10 Apr 2026 01:08:39 +0530 Subject: [PATCH] fix(desktop): bypass TCC permission check for screen recording and accessibility in debug builds On macOS Sequoia, CGPreflightScreenCaptureAccess() always returns false for ad-hoc signed or unsigned binaries regardless of System Settings, making it impossible to test locally without a Developer ID certificate. Adding a debug_assertions early return for ScreenRecording and Accessibility allows contributors to run and test the app locally without being blocked by the permissions screen. Camera and microphone are unaffected as they prompt correctly without a signed binary. Fixes #1722 Co-Authored-By: Claude Sonnet 4.6 --- apps/desktop/src-tauri/src/permissions.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/desktop/src-tauri/src/permissions.rs b/apps/desktop/src-tauri/src/permissions.rs index 17b9e7153e..345946d40c 100644 --- a/apps/desktop/src-tauri/src/permissions.rs +++ b/apps/desktop/src-tauri/src/permissions.rs @@ -156,6 +156,14 @@ pub(crate) fn sync_macos_dock_visibility(app: &tauri::AppHandle) { #[cfg(target_os = "macos")] fn macos_permission_status(permission: &OSPermission, initial_check: bool) -> OSPermissionStatus { + #[cfg(debug_assertions)] + if matches!( + permission, + OSPermission::ScreenRecording | OSPermission::Accessibility + ) { + return OSPermissionStatus::Granted; + } + match permission { OSPermission::ScreenRecording => { let granted = scap_screencapturekit::has_permission();