adb多设备调试

adb操作多个在线设备👺

  • PS C:\Users\cxxu\Desktop> adb --help
    Android Debug Bridge version 1.0.41
    Version 33.0.2-8557947
    Installed as D:\exes\platform-tools\adb.exe
    global options:
    -a listen on all network interfaces, not just localhost
    -d use USB device (error if multiple devices connected)
    -e use TCP/IP device (error if multiple TCP/IP devices available)
    -s SERIAL use device with given serial (overrides $ANDROID_SERIAL)
    -t ID use device with given transport id
    -H name of adb server host [default=localhost]
    -P port of adb server [default=5037]
    -L SOCKET listen on given socket for adb server [default=tcp:localhost:5037]
    --one-device SERIAL|USB only allowed with 'start-server' or 'server nodaemon', server will only connect to one USB device, specified by a serial number or USB device address.
    --exit-on-write-error exit if stdout is closed
    general commands:
    devices [-l] list connected devices (-l for long output)
    help show this help message
    version show version num
  • 注意到其中的:

    • -s SERIAL use device with given serial (overrides $ANDROID_SERIAL)
      -t ID use device with given transport id
    • 参数-s,-t都可用来指定设备,通常,使用-t会更加方便

  • 假设我当前有两台设备同时链接到同一台PC,且都处于在线状态(device而非offline),检查设备详情:adb devices -l

    PS C:\Users\cxxu\Desktop> adb devices -l
    List of devices attached
    194f4726 device product:mondrian model:23013RK75C device:mondrian transport_id:1
    cb41dced device product:lavender model:Redmi_Note_7 device:lavender transport_id:2
    • 其中第一个字段为serial(设备序列号字段)
    • 最后一个字段为通信端口字段trainsport_id
-s
  • PS C:\Users\cxxu\Desktop> adb -s 194f4726 shell
    mondrian:/ $ exit
    PS C:\Users\cxxu\Desktop> adb -s cb41dced shell
    lavender:/ $ exit
-t
  • PS C:\Users\cxxu\Desktop> adb -t 1 shell
    mondrian:/ $ exit
    PS C:\Users\cxxu\Desktop> adb -t 2 shell
    lavender:/ $ exit
posted @   xuchaoxin1375  阅读(24)  评论(0编辑  收藏  举报  
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
历史上的今天:
2023-08-09 LA@线性方程组@克拉默克拉姆Cramer法则
点击右上角即可分享
微信分享提示