XPC Error in Network Extension app in iOS Simulator

I've been working for a few months finishing up an NEPacketTunnelProvider implementation and application. I'm finished with the app and about ready to submit it to the App Store. I need to get screenshots for the app store listing, however I only have access to the following devices: 5.5-inch, 4-inch, and an iPad 4. This leaves 4.7-inch, 3.5-inch, and iPad Pro without screenshots.


Normally this wouldn't be a problem. However, whenever I try to save or load NEProxyTunnelProvider configurations in the iOS simulator for the devices I don't have physical access to, an XPC error is thrown. No configuration is salved, or loaded. Is there a way to configure the iOS simulator to work with Network Extensions, or am I going to have to track down beta users with each of these devices, put them in beta, and beg for screenshots?

Accepted Reply

Is there a way to configure the iOS simulator to work with Network Extensions …

No. The infrastructure for Network Extension (NE) providers is simply not present on the simulator because, conceptually, it lives ‘below’ the kernel, and the simulator is layered on the OS X kernel. Apps running in the simulator end up using OS X’s VPN.

One option would be to stub out the relevant bits of the NE back end so that your UI code can run on the simulator. When I’m working with NE I tend to do this anyway because:

  • it means I can debug my UI code on the simulator

  • it helps with testing (my mock objects can exercise transitions that are really hard to exercise with the real NE objects)

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Replies

Is there a way to configure the iOS simulator to work with Network Extensions …

No. The infrastructure for Network Extension (NE) providers is simply not present on the simulator because, conceptually, it lives ‘below’ the kernel, and the simulator is layered on the OS X kernel. Apps running in the simulator end up using OS X’s VPN.

One option would be to stub out the relevant bits of the NE back end so that your UI code can run on the simulator. When I’m working with NE I tend to do this anyway because:

  • it means I can debug my UI code on the simulator

  • it helps with testing (my mock objects can exercise transitions that are really hard to exercise with the real NE objects)

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
  1. Go to [(apple icon the top left corner) > About this Mac > Storage > Manage > Developer]
  2. Delete all the content (no worries!)

Taken from: https://stackoverflow.com/a/72238810/4345461