Our macOS application has an extension (network extension)
I played a little bit with extensions and I believe I figured out how PluginKit behaves on macOS:
- PluginKit registers an extension when an app with it launched for a first time
- PluginKit unregisters it when the app is deleted
- PluginKit updates registration when the app is moved.
Also, as I understand when PluginKit needs to load an extension it chooses the latest version.
However, I stumbled on so many problems:
On one machine, I run our application from XCode and for some reason plugin got unregistered and not registered again.
On another machine, I deleted an app and PluginKit didn't remove registration (and it tried to load an extension from a path which isn't there anymore)
I saw a registration magically disappear for one of beta users
And there was couple of other cases like that.
I found a way to trooubleshoot and fix it:
pluginkit -v -m -D -i <bundleid>
pluginkit -a <path>
pluginkit -r <path>
However, all of this is good when I am doing this on my local machine or on Beta tester machine.
How does it work in the wild? Do applications include some logic to clean up broken registrations and so on?