title: Extensions, PluginKit and craziness on macOS
body: <p>Our macOS application has an extension.</p>
  
  <p>As soon as an application with extension is launched for a first time, PluginKit registers it and when it's deleted then plugin is unregistred.</p>
  
  <p>PluginKit also have some algorithm how to choose which plugin to load (I assume it's just latest version).</p>
  
  <p>However, I stumbled on so many problems:</p>
  
  <ul>
  <li>I run application from XCode and for some reason plugin got unregistered</li>
  <li>I delete an app and PluginKit didn't remove registration</li>
  <li>I saw a registration magically disappear for one of beta users</li>
  </ul>
  
  <p>I am puzzled. This whole plugin behaves quite unreliably.</p>
  
  <p>I found a way to trooubleshoot and fix it:</p>
  
  <pre><code>pluginkit -v -m -D -i &lt;bundleid&gt;
  pluginkit -a &lt;path&gt;
  pluginkit -r &lt;path&gt;
  </code></pre>
  
  <p>Do you see such problems? How do you deal with these issues? Do you have some code (programmatically try to clean up pluginkit DB?)</p>