我想测试我的应用程序的低网络连接的情况。除了站在电梯里,还有什么最好的方法呢?我试过用铝箔纸包我的手机,但没有用。
我需要在真正的设备上测试它,而不是在模拟器上。
我想测试我的应用程序的低网络连接的情况。除了站在电梯里,还有什么最好的方法呢?我试过用铝箔纸包我的手机,但没有用。
我需要在真正的设备上测试它,而不是在模拟器上。
当前回答
或者在一个实际的设备上,你可以去设置->移动网络->首选的网络类型,并选择可用的最慢的… 当然,这是非常有限的,但对于某些测试目的,这可能足够了。
其他回答
我发现netlimiter4是将数据节流到模拟器的最佳解决方案。 它通过体面的gui提供粒度控制,并为每个进程的数据吞吐量提供图形化反馈。目前处于免费测试版。 截图
http://www.netlimiter.com/products/nl4
在游戏商店中有一些应用程序可以节流到实际设备上,但它们需要root(我不能提供任何关于它们工作得如何的建议,如果在所有- YMMV)。
在游戏商店搜索bradybound,我不能发布超过一个链接。
在模拟器中测试低/坏连接的应用程序的简单方法:
运行>运行配置,选择Android应用程序,然后进入目标选项卡。 查看模拟器启动参数。在这里,您可以轻松地修改网络速度和网络延迟。
这听起来可能有点疯狂,但微波炉是作为微波屏蔽的。因此,把你的设备放在微波炉里(当你的设备在里面的时候不要打开微波炉!)会导致你的信号强度显著下降。这绝对比站在电梯里强……
我需要在AndroidTV本机设备上限制低网络,根据我所读到的,最合适的解决方案是直接在我的路由器上限制互联网访问。 进入路由器设置(本地是smth,如192.168.0.1)->设置DHCP服务器(如果没有运行)->选择设备的IP地址并设置限制;
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/