Simulate Slow Internet Connection on a REAL device?

scatmoi picture scatmoi · Jul 15, 2012 · Viewed 10.1k times · Source

I need to test my application in conditions where even 2G Internet connectivity isn't at its full coverage (i.e. 2 bars instead of 4, 2G).

I prefer conducting these tests over WiFi.

Is there a way (programmatically or otherwise) to tell the Android OS on the real device to slow down or throttle Internet connection 56 Kbit/s?

Note: I know how to do this on the emulator. I'm looking for a way to do this on a real device.

Is this possible?

Answer

Eternal Learner picture Eternal Learner · Jul 17, 2012

In one of your comments you mentioned that you have a DD-WRT router, which is really a tiny Linux box. So you may be able to get a way with the tc command:

tc qdisc add dev $DEV root handle 1: cbq avpkt 1000 bandwidth 10mbit 
tc class add dev $DEV parent 1: classid 1:1 cbq rate 512kbit allot 1500 prio 5 bounded isolated 
tc filter add dev $DEV parent 1: protocol ip prio 16 u32 match ip dst 195.96.96.97 flowid 1:1