Network Extension Development Flow

I've been following these instructions and managed to get a development flow running: https://developer.apple.com/forums/thread/725805

However, my extension changes are only applied as follows:

  • Change the code
  • Remove the extension using OSSystemExtensionRequest.deactivationRequest
  • Restart Mac

If I don't do that, it seems that the old version of my extension keeps running. I confirmed this based on OSLogs that I added.

In other words: how can I ensure during development my latest code gets executed?

Replies

If I don't do that, it seems that the old version of my extension keeps running.

That’s not my experience. When I deactivate an extension I still see it in systemextensionsctl list but it’s flagged as deactivated. When I activate the new sysex the list shows two extensions, with the new one being loaded.

What version of macOS are you testing on?

What does systemextensionsctl list show at each stage?

Share and Enjoy

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

When I deactivate an extension I still see it in systemextensionsctl list but it’s flagged as deactivated

I see the same; the extension is deactivated. However, my app is still installed in /Application with the deactivated extension. Re-running from Xcode 14.2 and macOS 13.2.1 (22D68) I couldn't get my new build to execute.

I did find another way to solve it without restarting:

  • Remove application from /Applications
  • Press continue to confirm it will delete the app's extension
  • Clean my Trash bin
  • Re-run the app

This is a quick enough timeline, but obviously, ideally, I would just re-run from Xcode and have my latest Network Extension code working.