Is it possible to disable the network in iOS Simulator?

后端 未结 20 1265
名媛妹妹
名媛妹妹 2020-11-30 15:58

I am trying to debug some inconsistent behaviour I am seeing in an application that gets its primary data from the internet. I don\'t see the issues in the simulator, just

相关标签:
20条回答
  • 2020-11-30 16:38

    I'm afraid not—the simulator shares whatever network connection the OS is using. I filed a Radar bug report about simulating network conditions a while back; you might consider doing the same.

    0 讨论(0)
  • 2020-11-30 16:38

    You can throttle the internet connection with a 3rd party app such as

    Charles: http://www.charlesproxy.com/

    Hit command + shift + T on a Mac to setup the throttling.

    0 讨论(0)
  • 2020-11-30 16:38

    You can use the network link conditioner on your Mac. You can download it from the apple developer website. It should be available where we get the older versions of Xcode and iOS. With this network conditioner you can change the strength of the network from wifi to no network.

    Also when you install the network conditioner it gets installed in the system preferences.

    0 讨论(0)
  • 2020-11-30 16:40

    Just updating the answer to the current date. Since Xcode 4 (?) there is a preferences pane in /Applications/Utilities called Network Link Conditioner. Either you use one of the existent profiles or you create your own custom profile with 0 Kbps Up/Downlink and 100% dropped.

    0 讨论(0)
  • 2020-11-30 16:41

    Just turn off your WiFi in Mac OSX this works a treat!

    0 讨论(0)
  • 2020-11-30 16:43

    You can use Little Snitch to cut off network traffic to any individual process, including ones that run on the iOS simulator. That way you can keep your internet connection and disconnect your running app.

    0 讨论(0)
提交回复
热议问题