我正在寻找一种方式运行蠡脚本之前评估的设备上的网络质量 [英] I'm looking for a way to assess network quality on a device before running a calabash script

查看:210
本文介绍了我正在寻找一种方式运行蠡脚本之前评估的设备上的网络质量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是可能的蠡之内呢?我需要做这一切的自动化和运行脚本之间的网络评估。

Is this possible to do within calabash? I need to make this all automated and run a network assessment between scripts.

如果这是不可能的葫芦做的,有没有办法在Android上使用亚行做呢?

If this is not possible to do with calabash, is there a way do do it using adb on android?

编辑:我不想在Android / iOS应用我测试中嵌入这种

edit: I don't want to embed this within the android/ios app I'm testing.

通过网络质量我的意思是网络连接速度(所用的时间从一个特定的服务器下载文件)。

By network quality I mean internet access speed (time taken to download a file from a specific server).

推荐答案

我最终会做这个使用wget(使用忙碌箱安装)。

I end up doing this using wget (installed using busy box).

我发现在互联网上一组大小(从速度检查网站20MB的zip)的文件。
而我测下载文件所用的时间。然后,做了一些简单的数学表现出以KB的网速

I found a file of a set size on the internet (a 20MB zip from a speed checker site). And I measured the time taken to download the file. Then did some simple maths to show the network speed in Kbs

b=`date +%s`
adb shell wget http://download.thinkbroadband.com/20MB.zip -P /data/local/tmp
a=`date +%s`
adb shell rm /data/local/tmp/20MB.zip
n=$(($a - $b))
d=$((160000/$n))
echo Network speed was measured at $d Kbs

这篇关于我正在寻找一种方式运行蠡脚本之前评估的设备上的网络质量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆