Is it possible to mock the behavior of NWPathMonitor
for a specific app?
The scenario I want to support I've created an app called RocketSim, a developer tool for Xcode's Simulator. I've already created Airplane mode, which disables networking calls from URLSession from a specific bundle identifier app installed on the Simulator.
Now, I want to support blocking NWPathMonitor
as well. I believe the Simulator uses macOS's NWPathMonitor
and does not use any specific HTTP request or similar to determine the reachability state.
Is there a way I can make NWPathMonitor
return unsatisfied
when my 'airplane mode' is turned on? Potentially using a Network Extension?