The host app appears in Accessibility Permission

I'm learning XPC by inspecting the GitHub Copilot project. I figured out that the schema works as follows:

  1. The host app with a UI to manage settings
  2. A Service Extension that controls the Xcode Editor
  3. A communication bridge cli app that connects the first two

As far as I understand an app appears in the Accessibility Permission when it calls the next method:

let key = kAXTrustedCheckOptionPrompt.takeRetainedValue() as NSString
AXIsProcessTrustedWithOptions([key: true] as CFDictionary)

This method is only called by the Service Extension. However, when I run a release build from the /Application folder (where launch agents point to), there are two records appearing in the Accessibility Permission list:

  1. The host app
  2. The needed Service Extension

I compared all metadata files from Copilot with my copy line-by-line, but still can't figure out why the host app record appears in the Accessibility Permission, since the host app does not call the AXIsProcessTrustedWithOptions() method at all.

Could you give me any clue to help me wrap my head around it?

One more amazing thing. If I run my host app when Xcode is already run there is only one needed record appears in the Accessibility Permission list. Seems like, something in Xcode helps XPC to communicate properly.

I think you’re suffering from some terminological confusion here. We’re talking about Xcode source editor extensions, right? If so, those are app extensions, and in app extensions:

  • The host app is the one using the extension, which is this case would be Xcode.

  • The container app is the one in which the extension is embedded.

The way I read your post it seems like you have those reversed. Is that right?

Share and Enjoy

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

The host app appears in Accessibility Permission
 
 
Q