简体   繁体   中英

No network connectivity on iOS simulator but just with my app

I have no network connectivity when debugging my application in the Xcode simulator. The weird thing about this is:

  • I have connectivity in system apps like Safari
  • My colleagues don't have the same problem

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM