模拟真实设备上的互联网连接速度较慢? [英] Simulate Slow Internet Connection on a REAL device?
问题描述
我需要测试我的应用程序的条件下,甚至2G网络连接是不是在它的全覆盖(即2条代替4,2G)。
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).
我preFER通过WiFi进行这些测试。
I prefer conducting these tests over WiFi.
有没有一种方法(编程方式或其他方式)来告诉Android操作系统在真正的设备上减速或油门互联网连接56千比特/秒?
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.
这可能吗?
推荐答案
在您的评论你提到你有一个DD-WRT的路由器,这实在是一个很小的Linux机器之一。所以,你可以得到的方式与 TC 命令:
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
这篇关于模拟真实设备上的互联网连接速度较慢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!