SystemExtension activation status without popup

I have a system extension, it's not meant to be activated by user, i.e. this should be done by MDM. I'd like to verify if the extension is already active, but don't want to cause system popup because this is an error condition, i.e. something went wrong with MDM and we really don't want to confuse users with weird system popups coming out of nowhere. In short - not active, fine, give me an error, but please don't pop. Is there way to do this? Kind of what systemextensionsctl list command does.

Answered by DTS Engineer in 686999022

You could, but it has a few drawbacks:

  • The tool is not designed to be used as an API. Note the lack of a --xml or --json flag. The output format could change at any time in a way that breaks your parser.

  • It’ll only tell you whether the system thinks that the sysex is working, not whether the sysex is actually working.


Oh, one other thing: Have you seen the new-in-macOS 12 propertiesRequest(forExtensionWithIdentifier:queue:) method?

Share and Enjoy

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

I'd like to verify if the extension is already active

I’d do this by having your app talk to the sysex via XPC. If that works, you know that the sysex is installed and fully functional. If not, you have a problem.

Share and Enjoy

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

Couldn't you just run systemextensionsctl list | grep <your extension name> in an NSTask and parse the output, if any?

Accepted Answer

You could, but it has a few drawbacks:

  • The tool is not designed to be used as an API. Note the lack of a --xml or --json flag. The output format could change at any time in a way that breaks your parser.

  • It’ll only tell you whether the system thinks that the sysex is working, not whether the sysex is actually working.


Oh, one other thing: Have you seen the new-in-macOS 12 propertiesRequest(forExtensionWithIdentifier:queue:) method?

Share and Enjoy

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

SystemExtension activation status without popup
 
 
Q