ScreenCaptureKit doesn`t work on winlogon

I try capture screen on wingon. For start app on winlogon i register LaunchAgent to start on LoginWindow. Application is started, but callback getShareableContentExcludingDesktopWindows newer called, and application just stuck.

Replies

I’m not sure what “winlogon” is but…

If you’re trying to use ScreenCaptureKit from a pre-login context, that won’t work. I researched this earlier this year as part of a DTS incident and the end result is that ScreenCaptureKit is not currently available to pre-login agents (FB12776922). If you need to record the screen in that environment, use a legacy API like CGDisplayStream.

If your product works in multiple environments — for example, a screen sharing program that runs as both a pre-login and a regular GUI agent — I recommend that you write two code paths:

  • Use ScreenCaptureKit in the regular case.

  • Use legacy APIs in the pre-login case.

Share and Enjoy

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

  • Yep, application work on pre-login context. I use CGDisplayStream now, but his depricated, and his can`t exclude window from capture. According to my research teamviewer somehow use ScreenCaptureKit on pre-login context.

  • @ecspertiza do you have a source for that? It sounds like this might be a special permissions thing, where it only works if apple gives a developer the permission (much like USB forwarding)

Add a Comment