Reputation: 1465
I have no network connectivity when debugging my application in the Xcode simulator. The weird thing about this is:
I've gone to the lengths of uninstalling Xcode and clearing every cached directory I can think of but to no avail.
Has anyone faced this? Does anyone have any clue what might cause it?
Upvotes: 2
Views: 3090
Reputation: 17219
The Simulator uses the iOS/tvOS/watchOS userspace on top of the host mac kernel, so network connectivity in the Simulator is whatever connectivity your mac has. If Safari inside the Simulator is succeeding then it is likely that you are running into App Transport Security or you are on a corporate network configuration that requires some special configuration or is blocking non-HTTP traffic. (I've also seen third party kernel extensions break the Simulator quite often, eg Virus Scanners).
You may be able to diagnose further by adding a WKWebView to your app, then see if that web view is able to load a public website over HTTPS.
If it still isn't working for you please run xcrun simctl diagnose
and attach to a bug report at https://bugreport.apple.com so we can take a look.
Upvotes: 1