V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
linhua
V2EX  ›  Android

adb 传输速度测试

  •  
  •   linhua · 2018-12-07 18:32:01 +08:00 · 9219 次点击
    这是一个创建于 1938 天前的主题,其中的信息可能已经有所发展或是发生改变。

    结论: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

    4 条回复    2018-12-15 16:24:34 +08:00
    junjieyuanxiling
        1
    junjieyuanxiling  
       2018-12-08 03:13:38 +08:00 via Android
    几天前接线 push 速度是 22MB/s,USB 2.0。
    junjieyuanxiling
        2
    junjieyuanxiling  
       2018-12-08 03:15:01 +08:00 via Android
    push 的是 700+ MB 的系统镜像,基本算 USB 2.0 满速了。
    linhua
        3
    linhua  
    OP
       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
        4
    yukiww233  
       2018-12-15 16:24:34 +08:00
    mi6 在 5ghz 环境传输大文件最多稳定在 60MB/s 左右
    国内一大票厂商死都不上 usb3.0
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4095 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 05:23 · PVG 13:23 · LAX 22:23 · JFK 01:23
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.