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 any way of disabling the network in the simulator?
(I am connecting to the Mac remotely to code, no other choice right now, so disabling the OS network isn't an option).
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.
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 ;-)
Yes. In Xcode, you can go to Xcode
menu item -> Open Developer Tools
-> More 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.
链接地址: http://www.djcxy.com/p/30666.html上一篇: iOS模拟器屏幕截图存储在哪里?
下一篇: 是否可以在iOS模拟器中禁用网络?