我想测试我的应用程序的低网络连接的情况。除了站在电梯里,还有什么最好的方法呢?我试过用铝箔纸包我的手机,但没有用。
我需要在真正的设备上测试它,而不是在模拟器上。
我想测试我的应用程序的低网络连接的情况。除了站在电梯里,还有什么最好的方法呢?我试过用铝箔纸包我的手机,但没有用。
我需要在真正的设备上测试它,而不是在模拟器上。
当前回答
Facebook建立了一个叫做增强交通控制的东西。GitHub页面上的简要总结:
Augmented Traffic Control (ATC) is a tool to simulate network conditions. It allows controlling the connection that a device has to the internet. Developers can use ATC to test their application across varying network conditions, easily emulating high speed, mobile, and even severely impaired networks. Aspects of the connection that can be controlled include: bandwidth latency packet loss corrupted packets packets ordering In order to be able to shape the network traffic, ATC must be running on a device that routes the traffic and sees the real IP address of the device, like your network gateway for instance. This also allows any devices that route through ATC to be able to shape their traffic. Traffic can be shaped/unshaped using a web interface allowing any devices with a web browser to use ATC without the need for a client application.
你可以在GitHub上找到它:https://github.com/facebook/augmented-traffic-control
他们还为此写了一篇博客:https://code.facebook.com/posts/1561127100804165/augmented-traffic-control-a-tool-to-simulate-network-conditions/
其他回答
我很惊讶没人提到这一点。你可以通过蓝牙连接,并将它们分开十多米(或更少的障碍物)。你的信号很差。没有微波炉,没有电梯,不需要软件。
运行>运行配置,选择Android应用程序,然后进入目标选项卡。按照图中所示进行更改。
几岁了,但是嘿,我会用Genymotion来配合我的万无一失的方法。
下载Charles免费试用版:http://www.charlesproxy.com/download/ 安装它 ClickProxy ->节流阀设置 设置HTTP节流速度 关闭窗口 单击“Proxy -> Throttling”,开启节流阀 打开Genymotion模拟器 打开wifi设置 长按开启的wifi连接 单击“修改网络” 单击“显示高级选项” 设置代理为手动 设置Proxy主机名为10.0.3.2 端口设置为“8888” 点击保存
现在你的网络将被阻塞!
Android工作室AVD更新:
开放式AVD管理器 创建/编辑AVD 点击高级设置 选择您首选的连接设置
没有微波炉和电梯:)
我发现netlimiter4是将数据节流到模拟器的最佳解决方案。 它通过体面的gui提供粒度控制,并为每个进程的数据吞吐量提供图形化反馈。目前处于免费测试版。 截图
http://www.netlimiter.com/products/nl4
在游戏商店中有一些应用程序可以节流到实际设备上,但它们需要root(我不能提供任何关于它们工作得如何的建议,如果在所有- YMMV)。
在游戏商店搜索bradybound,我不能发布超过一个链接。