Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to disable the network in iOS Simulator?

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 on the device, so I'd like to reproduce the network and connectivity environment in the simulator.

Is there a way of disabling the network in the simulator?

(I am connecting to the Mac remotely to code, and there isn't any other choice right now, so disabling the OS network isn't an option).

like image 924
Paul Hammond Avatar asked Jan 26 '11 18:01

Paul Hammond


People also ask

How do I lock my iPhone simulator?

Yep. In the menu bar when you've got the iOS Simulator open, Click Hardware -> Lock. Note that this looks slightly different than actually sleeping the phone (it keeps the "slide to unlock" screen running), but achieves the same effect. You can also do other nifty things like rotate the device and hit the home button.

How do I use network conditioner in iOS simulator?

Simulate Poor Network on iPhoneOpen the Settings app and navigate to the Developer option. Select the Network Link Conditioner under NETWORKING option. Now enable the Network Link Conditioner & choose the network profile you want, and start testing how your app works in different conditions.

Where does the iPhone simulator store its data?

type: ~/Library/Application Support/iPhone Simulator.

Is iOS simulator like the hardware?

An iOS Simulator basically mimics an iOS app or browser on top of a developer's operating system. This is viewable in an iPad or iPhone like window. They cannot virtualize the actual hardware conditions of an iOS device, which is the main requirement for comprehensive testing and debugging.


2 Answers

Use a simple Faraday cage to block or limit the external RF signal level.

You can make your own with aluminum foil. The openings should be smaller than the wavelength of your data service if that's what you want to block.

  • 800 MHz has a 37 cm (14") wavelength
  • 1900 MHz has a 16 cm (6") wavelength.

This works better with an actual device than with the simulator since the Mac is hard to work on when inside the Faraday cage ;-)

Enter image description here

like image 52
progrmr Avatar answered Sep 22 '22 02:09

progrmr


Yes. In Xcode, you can go to menu Open Developer ToolsMore Developer Tools and download "Additional Tools for Xcode", which will have the Network Link Conditioner.

Using this tool, you can simulate different network scenarios (such as 100% loss, 3G, high-latency DNS, and more) and you can create your own custom ones as well.

like image 33
swathy valluri Avatar answered Sep 22 '22 02:09

swathy valluri