Problem
It is currently impossible to test any screen-recording-related functionality locally on macOS Sequoia using a debug build. `CGPreflightScreenCaptureAccess()` always returns `false` for ad-hoc signed or unsigned binaries regardless of what permissions are granted in System Settings.
What was tried
-
Running the raw binary directly (`cargo build` + `./target/debug/cap-desktop`) — TCC has no bundle identity to associate the grant with, so permission is always denied.
-
Wrapping in a `.app` bundle with `codesign --sign "-"` — Signing with ad-hoc identity and a stable `CFBundleIdentifier` (`so.cap.desktop.dev`) and running via `open MyApp.app`. macOS Sequoia silently rejects ScreenCaptureKit access for ad-hoc signed apps with no Team ID. `CGPreflightScreenCaptureAccess()` still returns `false` even after granting in System Settings.
-
`tccutil reset ScreenCapture ` + fresh grant — Cleared stale TCC entries and re-triggered `CGRequestScreenCaptureAccess()`. The system dialog appeared, user approved, but on relaunch `CGPreflightScreenCaptureAccess()` still returned `false`. macOS Sequoia appears to not honor the grant for ad-hoc identities.
-
Matching bundle ID to what System Settings shows — Tried changing `CFBundleIdentifier` to `cap-desktop` to match the existing TCC entry. Same result.
-
Frameworks copy issue — `cp -R target/Frameworks` copies symlinks as real directories, causing `codesign` to fail with "unsealed contents present in root directory of embedded framework". Fixed by copying from `target/native-deps/Spacedrive.framework` which has proper relative symlinks.
Root cause
macOS Sequoia enforces that `CGPreflightScreenCaptureAccess()` / ScreenCaptureKit requires a binary signed with a valid Apple Developer ID certificate (with a Team ID). Ad-hoc signing (`codesign --sign "-"`) doesn't satisfy this requirement. This is a regression from earlier macOS versions where ad-hoc signed bundles could get TCC grants.
What currently works as a workaround
The only way to test locally is to bypass the permission check in debug builds:
```rust
OSPermission::ScreenRecording => {
#[cfg(debug_assertions)]
return OSPermissionStatus::Granted;
// real check below...
}
```
This is obviously not something that should be committed to main.
Suggested fix
Add an official `#[cfg(debug_assertions)]` bypass for `ScreenRecording` and `Accessibility` in `permissions.rs` that skips the TCC check in debug builds. This would let contributors test locally without needing a signed build. The bypass would never ship in release builds.
Alternatively, document a supported way to test dev builds (e.g. via `pnpm tauri dev` with a proper signing identity set up).
Impact
Any contributor on macOS Sequoia cannot test the permissions flow, screen recording, or any feature that requires passing the permissions screen in a debug build. This significantly raises the barrier for contributions.
Problem
It is currently impossible to test any screen-recording-related functionality locally on macOS Sequoia using a debug build. `CGPreflightScreenCaptureAccess()` always returns `false` for ad-hoc signed or unsigned binaries regardless of what permissions are granted in System Settings.
What was tried
Running the raw binary directly (`cargo build` + `./target/debug/cap-desktop`) — TCC has no bundle identity to associate the grant with, so permission is always denied.
Wrapping in a `.app` bundle with `codesign --sign "-"` — Signing with ad-hoc identity and a stable `CFBundleIdentifier` (`so.cap.desktop.dev`) and running via `open MyApp.app`. macOS Sequoia silently rejects ScreenCaptureKit access for ad-hoc signed apps with no Team ID. `CGPreflightScreenCaptureAccess()` still returns `false` even after granting in System Settings.
`tccutil reset ScreenCapture ` + fresh grant — Cleared stale TCC entries and re-triggered `CGRequestScreenCaptureAccess()`. The system dialog appeared, user approved, but on relaunch `CGPreflightScreenCaptureAccess()` still returned `false`. macOS Sequoia appears to not honor the grant for ad-hoc identities.
Matching bundle ID to what System Settings shows — Tried changing `CFBundleIdentifier` to `cap-desktop` to match the existing TCC entry. Same result.
Frameworks copy issue — `cp -R target/Frameworks` copies symlinks as real directories, causing `codesign` to fail with "unsealed contents present in root directory of embedded framework". Fixed by copying from `target/native-deps/Spacedrive.framework` which has proper relative symlinks.
Root cause
macOS Sequoia enforces that `CGPreflightScreenCaptureAccess()` / ScreenCaptureKit requires a binary signed with a valid Apple Developer ID certificate (with a Team ID). Ad-hoc signing (`codesign --sign "-"`) doesn't satisfy this requirement. This is a regression from earlier macOS versions where ad-hoc signed bundles could get TCC grants.
What currently works as a workaround
The only way to test locally is to bypass the permission check in debug builds:
```rust
OSPermission::ScreenRecording => {
#[cfg(debug_assertions)]
return OSPermissionStatus::Granted;
// real check below...
}
```
This is obviously not something that should be committed to main.
Suggested fix
Add an official `#[cfg(debug_assertions)]` bypass for `ScreenRecording` and `Accessibility` in `permissions.rs` that skips the TCC check in debug builds. This would let contributors test locally without needing a signed build. The bypass would never ship in release builds.
Alternatively, document a supported way to test dev builds (e.g. via `pnpm tauri dev` with a proper signing identity set up).
Impact
Any contributor on macOS Sequoia cannot test the permissions flow, screen recording, or any feature that requires passing the permissions screen in a debug build. This significantly raises the barrier for contributions.