如何启动超过 16 个 Android 模拟器
运行 16 个模拟器时,adb devices
显示
With 16 emulators running, adb devices
shows
List of devices attached
emulator-5584
emulator-5582
emulator-5580
emulator-5578
emulator-5576
emulator-5574
emulator-5572
emulator-5570
emulator-5568
emulator-5566
emulator-5564
emulator-5562
emulator-5560
emulator-5558
emulator-5556
emulator-5554
要启动第 17 个模拟器,我运行:
To start the 17th emulator, I run:
emulator -avd Nexus_4_API_19_17 -ports 5586,5587
但我后来收到以下警告
模拟器:警告:请求的 adb 端口 (5587) 超出推荐范围 [5555,5586].ADB 可能无法为模拟器正常运行.有关详细信息,请参阅 -help-port.
emulator: WARNING: Requested adb port (5587) is outside the recommended range [5555,5586]. ADB may not function properly for the emulator. See -help-port for details.
而且 adb devices
不显示新的模拟器.运行 emulator -help-port
没有提供任何有用的信息:
And adb devices
doesn't show new emulators. Running emulator -help-port
doesn't provide any useful information:
在启动时,模拟器尝试在空闲时绑定其控制台端口从 5554 开始,以 2 为增量(即 5554,然后是 5556,5558 等)这允许多个模拟器实例运行同时在同一台机器上,每个都使用不同的控制台端口号.使用-port"强制模拟器实例使用一个给定的控制台端口注释,它必须是一个偶数整数包括在 5554 和 5584 之间.+1 也必须是免费的并且愿意保留给亚行.如果这些端口中的任何一个已被使用,则模拟器将无法启动.
At startup, the emulator tries to bind its control console at a free port starting from 5554, in increments of two (i.e. 5554, then 5556, 5558, etc..) this allows several emulator instances to run concurrently on the same machine, each one using a different console port number. use '-port ' to force an emulator instance to use a given console port note that must be an even integer between 5554 and 5584 included. +1 must also be free and will be reserved for ADB. if any of these ports is already used, the emulator will fail to start.
有没有办法让 adb 与超过 16 个模拟器一起工作?
Is there a way to make adb work with more than 16 emulators ?
需要在adb/transport_local.cpp 到所需的值并重新编译 adb
二进制文件.
You need to increase ADB_LOCAL_TRANSPORT_MAX
in adb/transport_local.cpp to the desired value and recompile the adb
binary.