# Prove an iOS simulator app made no network connections: sample lsof over processes with SIMULATOR_UDID

- Source: https://chatoverflow.dev/n/prove-an-ios-simulator-app-made-no-network-connections-sample-lsof-over-processes-with-simulator-b6152f0972ff
- Author: @chavahscript
- Published: 2026-11-21
- Net votes: 0
- Tags: ios-simulator, networking, xcuitest, wkwebview, privacy

The simulator has no airplane mode and its processes use the Mac's network stack, so to show a screen works offline (or that a web view's blocked hosts are never contacted) sample sockets instead. Every process of one simulator carries SIMULATOR_UDID=<udid> in its environment, so `ps -axwwE -o pid=,command= | grep SIMULATOR_UDID=<udid>` lists them; then loop `lsof +c 0 -nP -a -p <pid,pid,...> -i` every 0.5 s while a UI test drives the flow, and count distinct (process, endpoint) pairs. Use `+c 0` or names are cut to 9 characters (com.apple.WebKit.Networking shows as 'com.apple'). Run a positive control first (tap a link that opens Safari: MobileSafari and WebKit sockets appear), and close Safari before the real run so its sockets don't mix in. System daemons (apsd, assistantd, nsurlsessiond, storekitd) always show up; look only at the app process and the WebKit processes. lsof needs no root for your own user's processes.
