adb 传输速度测试

2018-12-07 18:32:01 +08:00
 linhua

结论:adb 协议传输文件比较慢

adb 版本 1.0.40

adb wifi 开启

用 usb 线连接 Android 手机和 PC

adb tcpip 5555

拔掉 USB 线,Android 手机连接 wifi,获得 ip 地址 x.x.x.x

adb connect x.x.x.x:5555

网络测试命令

PC 端

.\caddy -port 80

Android 命令行

PC 端相应网络接口的 IP xx.xx.xx.xx

./aria2c "http://xx.xx.xx.xx/amap.apk" --file-allocation=none && rm amap.apk

timeout 1 ./busybox wget "http://xx.xx.xx.xx/amap.apk" ; ./busybox ls -lh amap.apk && rm amap.apk

结果

usb 线(电脑 USB3.0,手机 MicroUSB 2.0 接口) 共享网络(tethering) 33MB/s

usb 线(电脑 USB3.0,手机 MicroUSB 2.0 接口) adb push 7MB/s

usb 线(电脑 USB3.0,手机 MicroUSB 2.0 接口) adb reverse tcp port 5.1MB/s (比直接 adb push 还低)

adb wifi -- 2.4G wifi(笔记本共享 wifi,无路由器) 4.15MB/s

adb wifi -- 5G wifi(笔记本共享 wifi,无路由器) 20MB/s

adb wifi -- 2.4G wifi(笔记本共享 wifi,无路由器) adb push 1MB/s

adb wifi -- 5G wifi(笔记本共享 wifi,无路由器) adb push 1.5MB/s

用笔记本共享 wifi,ping 延时不稳定。如果连路由器的 wifi,速度应该快点

adb 代码

adb push

https://github.com/aosp-mirror/platform_system_core/blob/master/adb/client/main.cpp#L202

https://github.com/aosp-mirror/platform_system_core/blob/1f8147fb195e48a610e1024e563954dcca566fc4/adb/client/commandline.cpp#L1670

https://github.com/aosp-mirror/platform_system_core/blob/46f281edf5e78a51c5c1765460cddcf805e88d48/adb/client/file_sync_client.cpp#L1031

adb install-multiple (在 Android studio 中被使用,取代 adb install )

$ adb install-multiple -r -t ....

$ adb shell am start -n ....

https://github.com/aosp-mirror/platform_system_core/blob/master/adb/client/commandline.cpp#L1690

https://github.com/aosp-mirror/platform_system_core/blob/ec54ef7a8d762ca35f6b4a63925ab2e72ce85d13/adb/client/adb_install.cpp#L500

9839 次点击
所在节点    Android
4 条回复
junjieyuanxiling
2018-12-08 03:13:38 +08:00
几天前接线 push 速度是 22MB/s,USB 2.0。
junjieyuanxiling
2018-12-08 03:15:01 +08:00
push 的是 700+ MB 的系统镜像,基本算 USB 2.0 满速了。
linhua
2018-12-10 09:10:13 +08:00
@junjieyuanxiling
你的手机应该是 Android 7.0 以上版本

‘’‘’
What's new in Android N adb/shell?

adb push/pull/sync much faster. (AOSP N9 full /system sync down from 60s to 20s.) Now with better progress feedback showing percentage complete.
”‘’ 自 https://plus.google.com/+ElliottHughes/posts/fHa6Yg3bE1W

Android N adb push 的速度相比之前快了三倍左右,3 * 7 = 21MB/s ,但还是没有 usb 共享网络(USB Tethering)快

我用的测试手机是 红米 Note 4,Android 6.0 版本
yukiww233
2018-12-15 16:24:34 +08:00
mi6 在 5ghz 环境传输大文件最多稳定在 60MB/s 左右
国内一大票厂商死都不上 usb3.0

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/515462

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX