iPhone simulator - simulate 3G connection

不问归期 提交于 2019-12-17 23:25:09

问题


I am testing the Reachability api, but my physical device only has WiFi access, as I don't have a phone contract. My code needs to distinguish between being connected to 3G/2G or WiFi. Is it possible to simulate a 3G connection on the iPhone simulator?

Clarifications: I am using Snow Leopard. Limiting the bandwidth is not what I need. I need for the actual interface to be identified as the 3G or 2G radio, as opposed to WiFi.


回答1:


If you are using Lion try the Network Link Conditioner

Nowdays there is a part in Preferences on the device (when registered as a developer device) where a "Network Link Conditioner" is available.




回答2:


You might also like Speed Limit.

Edit: I'm not sure if this will work as an identifier for 3g though. I'll update my answer after I do some tests (I'm working on exactly the same thing right now!)




回答3:


I dont think that it is a build-in-functionality in iphone-simulator. But I test it sometimes on my device with wifi (and 3g) disabled.

If you dont have an iPhone but sth. similar (Android for instance) then just enable tethering on your device and use the tethered internet-connection. Then your iPhone-Simulator only gets slow speed ;)

edit: another idea is to limit the bandwidth of your mac. I found this tool online (have not tested it) which should be able to limit network-traffic (to your local router/modem)



来源:https://stackoverflow.com/questions/7596930/iphone-simulator-simulate-3g-connection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!