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
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
2023-08-09 LA@线性方程组@克拉默克拉姆Cramer法则