ScreenCaptureKit permissions lost after every build — solved by switching signing identity

Sharing a solution for a problem that took me a while to figure out.

Problem: During development of a macOS 26 app that uses ScreenCaptureKit, the screen capture permissions were being reset after every build. Each time I compiled and ran the app from Xcode, I had to re-authorize screen capture in System Settings. CGPreflightScreenCaptureAccess() would return false even though I'd just granted permission minutes ago.

Root cause: I was using ad-hoc code signing during development. macOS ties screen capture permissions to the app's code signing identity. With ad-hoc signing, the identity changes on every build, so the system treats each build as a "new" app.

Solution: Switch to an Apple Development certificate for debug builds. In Xcode:

  • Build Settings → Code Signing Identity → Debug → set to "Apple Development"
  • Make sure your development team is selected

After this change, the signing identity remains stable across builds, and screen capture permissions persist.

This might be related to the broader issue discussed in this forum about ScreenCapture permissions disappearing — if other developers are seeing permissions vanish, it's worth checking whether the code signing identity is changing between sessions.

With ad-hoc signing … the system treats each build as a "new" app.

Correct.

If you’re curious about the mechanics of this, have a read of TN3127 Inside Code Signing: Requirements.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

ScreenCaptureKit permissions lost after every build — solved by switching signing identity
 
 
Q