I have a bug in my app that happens when the app is "offline" without and internet connection. The app should still work as it stores content locally. However I am struggling to debug the issue because turning off WiFi breaks the connection to the Xcode debugger, even though it is plugged in via USB.
Did I turn on some setting to debug over WiFi? How do I debug over USB so I can see the log output without a network connection to the iPhone?
In general, Xcode should be able to debug over USB just fine. Consider this sequence:
-
I connected my iOS device via USB. It’s running iOS 17.6.1 and supports both Wi-Fi and WWAN.
-
On the device, I used Settings > Wi-Fi to turn Wi-Fi off completely [1].
-
Using Xcode 16.0 on macOS 14.6.1, I created a new test app from the iOS > App template.
-
I lowered the deployment target to iOS 17, because the default project targets iOS 18.
-
I built and ran the app on the device. That worked as expected.
-
I choose Debug > Pause, and verified that the debugger is working.
-
I stopped the app.
-
Back on the device, in Settings, I turned on Airplane Mode. This disables WWAN as well.
-
Back in Xcode, I repeated steps 5 and 6. Debugging continues to work.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] Turning Wi-Fi off in Settings actually turns it off; turning it off in Control Center just leaves the current network for the rest of the day.