在mac环境下,对android网络性能进行iperf测试,步骤如下:

1. iperf的安装

Mac的iperf安装

brew install iperf

android的iperf,有两种方式,一种安装iperf apk,下载地址:https://iperf.fr/iperf-download.php ,第二种方式为用iperf binary, 下载: https://pan.baidu.com/s/11voArkUDLV7eXEj2EzDvBA 密码: 8ael (android 9测试有效)

2. iperf的基本使用

服务端
iperf -s -p 5001 -P 1 -f m -i 2
# 说明:
# -s      表示作为服务端启动
# -p 5001 表示监听的端口为5001
# -P 1    表示服务端与客户端之前的线程数为1。客户端同时使用此参数
# -f m    表示显示数据相关大小时输出格式为Mbps
# -i 2    表示每2秒刷新一次log

客户端
iperf -c xx.xx.xx.xx -p 5001 -t 60 -P 1 -n 100M
# 说明:
# -c xxxx 表示作为客户端启动,xx.xx.xx.xx即服务端ip地址
# -p 5001 表示服务端监听的端口为5001
# -t 60   表示测试时长为60秒
# -P 1    表示客户端与服务端之间的线程数为1。服务端同时使用此参数
# -n 100M 表示发送总数据量为100M。此时-t限定的时长将无效
# -i 2    表示每2秒刷新一次log

3. 测试流程:

Mac服务器端:

$ iperf -s -p 5001 -P 1 -f m -i 2------------------------------------------------------------Server listening on TCP port 5001TCP window size: 0.12 MByte (default)------------------------------------------------------------[  4] local 192.168.10.72 port 5001 connected with 192.168.10.64 port 60334[ ID] Interval       Transfer     Bandwidth[  4]  0.0- 2.0 sec  4.12 MBytes  17.3 Mbits/sec[  4]  2.0- 4.0 sec  8.45 MBytes  35.4 Mbits/sec[  4]  4.0- 6.0 sec  21.2 MBytes  89.0 Mbits/sec[  4]  6.0- 8.0 sec  21.6 MBytes  90.6 Mbits/sec[  4]  8.0-10.0 sec  21.0 MBytes  88.1 Mbits/sec[  4] 10.0-12.0 sec  20.4 MBytes  85.7 Mbits/sec[  4]  0.0-12.3 sec   100 MBytes  68.1 Mbits/sec[SUM]  0.0-12.3 sec   104 MBytes  70.9 Mbits/sec

Android客户端:

/data/local/tmp # ./iperf -c 192.168.10.72 -p 5001 -t 60 -P 1 -n 100M------------------------------------------------------------Client connecting to 192.168.10.72, TCP port 5001TCP window size: 1.00 MByte (default)------------------------------------------------------------[  3] local 192.168.10.64 port 60334 connected with 192.168.10.72 port 5001[ ID] Interval       Transfer     Bandwidth    [  3]  0.0-12.2 sec    100 MBytes  68.7 Mbits/sec

更多相关文章

  1. Android客户端性能测试常见指标及测试方法
  2. 一文全面了解Android单元测试
  3. Android仿人人客户端(v5.7.1)——网络模块处理的架构
  4. Android客户端与PC服务端、android服务端通过WiFi通信
  5. Robotium
  6. Android(安卓)Service待机/睡眠时运行
  7. android SQLite数据库的增删改查以及事务的单元测试
  8. Android单元测试 Only the original thread that created a view
  9. Android Socket编程

随机推荐

  1. 深入浅出android/ophone UI实现水平布局
  2. android的Activity之间的数据传递
  3. Android Studio 快捷键大全
  4. 布局资源(layout)的简单使用
  5. Android中Style和Theme的使用总结
  6. Andriod编程入门知识
  7. 使用gdb在Android(安卓)Emulator中进行调
  8. Chris:怎样成为一名Android应用开发者
  9. 从底部弹出的PopupWindow
  10. Android的图表世界–如何使用MPAndroidCh