gpt4 book ai didi

android - 连接到 ADB 服务器的最大设备数

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:52:18 25 4
gpt4 key购买 nike

根据 Android Debug Bridge :

The server then sets up connections to all running emulator/deviceinstances. It locates emulator/device instances by scanningodd-numbered ports in the range 5555 to 5585, the range used byemulators/devices. Where the server finds an adb daemon, it sets up aconnection to that port. Note that each emulator/device instanceacquires a pair of sequential ports — an even-numbered port forconsole connections and an odd-numbered port for adb connections. Forexample:

Emulator 1, console: 5554

Emulator 1, adb: 5555

Emulator 2, console: 5556

Emulator 2, adb: 5557 ...

ADB 服务器仅通过扫描 5555 到 5585 范围内的奇数端口(总共 30 个端口)来检查设备,并为每个设备分配 2 个端口。 ADB 是否能够接受超过 15 个 Android 设备(15x2 端口)或者我可以在同一台计算机上连接更多设备?我认为不可能在同一台机器上运行多个 ADB 服务器。

最佳答案

您可以使用环境变量 ANDROID_ADB_SERVER_PORT 在同一台计算机上运行多个 adb 实例。查看更多详情 this answer .

使用模拟器上的-ports 选项,您可以指定任何端口,然后执行:

$ adb connect localhost:PORT

如果您的手机已 root,您可以在另一个端口上重新启动 adbd(参见 another answer),然后:

$ adb connect IP_OF_DEVICE:PORT

设备随后可通过 wifi 访问,无需插入。请注意,您 wifi 网络上的任何人都可以通过这种方式访问​​您的手机!

关于android - 连接到 ADB 服务器的最大设备数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9924274/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com