ScreenCapture permissions disappear and don't return

On Tahoe and earlier, ScreenCapture permissions can disappear and not return. Customers are having an issue with this disappearing and when our code executes CGRequestScreenCaptureAccess() nothing happens, the prompt does not appear. I can reproduce this by using the "-" button and removing the entry in the settings, then adding it back with the "+" button. CGPreflightScreenCaptureAccess() always returns the correct value but once the entry has been removed, CGRequestScreenCaptureAccess() requires a reboot before it will work again.

My general approach for problems like this is to set up a VM that’s never seen my product before and then use that VM to test various user-level sequences. For example, I might install version N of the app, check that screen capture works, then install version N+1, and then check that it continues to work.

The advantage of doing this on a VM is that you’re starting from a fresh machine and you can save and restore snapshots for your various tests.

If your product passes those tests, and thus works in general, this becomes a question of what’s happening on specific user machines to cause the reported issue? That’s a much harder question to answer. macOS has lots of flexibility — with the user able to install and remove apps at will, install multiple copies of your app, and so on — and that flexibility causes serious challenges for TCC. There’s no easy way to map from specific symptoms back to the root cause.

However, it’s unlikely to be your app’s issue. I mean, there’s nothing you can do at the code level to remove your screen capture privilege. Given that, the logic next step is to report these problems to Apple.

And that raises the issue of how to file an actionable bug report. They only specific guidance I can give there is that the bug report — either filed by you or by your users — really needs a sysdiagnose log, ideally one taken shortly after first seeing the problem.

If you or your users file any bugs about this, please post the bug numbers, just for the record.

Share and Enjoy

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

ScreenCapture permissions disappear and don't return
 
 
Q