views:

126

answers:

6

I have an application that does a lot of binary data loading. I've encountered scenarios where an unstable 3G connection may intermittently cut out during the loading of some of this binary data, causing issues.

Is there any way, using the simulator or otherwise, to test for low-bandwidth/unstable connection scenarios?

I seem to recall Adobe Flash having bandwidth simulators in their test suite.

A: 

Well, low bandwidth is simple: turn off Wifi, turn off 3G. Cutting connection is also simple: turn on wifi, get connected, power off your wifi access point.

unbeli
A: 

I guess you could connect to a Mac (if you had one) setup as a WiFi base station (ad-hoc network). Then on the Mac set up a "dummynet" bandwidth limit and/or high packet loss filter.

That's what I do to simulate the slower higher-latency DSL lines I am making software to setup for Macs.

ExitToShell
A: 

On the iPhone you can't. One way would be to share your computer WIFI connection to your iPhone but to slow it down using a special application.

This blog post describes some approaches for that:

http://blog.aptivate.org/2010/01/23/make-sure-your-apps-work-in-the-field/

texmex5
+1  A: 

I read of someone testing with their iPhone connected by USB cable and the phone wrapped in aluminum foil to get the cellular signal reduced. You can turn off WiFi and 3G and just have Edge and then attenuate it with foil. Sounds crude but...

You could also use an iPhone 4 and hold in your hand to short the two antennas together ;-)

progrmr
+2  A: 

You could test a number of things if you turn 3G off and connect to wifi.

  1. Log into your router and rate limit the mac address of your iphone. (to test slow connections)

  2. Kill the power to the wifi when in the middle of downloading data

  3. Reboot the wifi router when downloading so the phone has connection, loses it, and gets it again. ( to test different scenarios )

Happy Coding!

Louie
+2  A: 

Here is a great script I've used on OS X to throttle connection speed, or just turn it off, for any domain you want. I wish I could remember where I got it from to give credit.

Save the code to a file on your machine and name it "throttling". Then to run, just enter the below in terminal, and select from one of these speeds: [full|fast|medium|slow|wwdc|off].

"./throttling medium"

If you have the script set up to throttle localhost:3000 and stackoverflow.com, then loading up a page from either of those domains in your browser (or iphone simulator or whatever) will respond slower and load files slower. It's been really great for testing iphone connectivity bugs.

http://gist.github.com/499177

Arrel