adb: unable to connect for root: more than one device/emulator
时间: 2023-09-25 08:06:09 浏览: 196
这个问题通常出现在你连接多个设备或模拟器时。你需要指定要连接的设备或模拟器的序列号。在终端中输入以下命令:
```
adb -s <device_serial_number> root
```
其中,`<device_serial_number>` 是你要连接的设备或模拟器的序列号。你可以使用以下命令列出当前连接的设备或模拟器的序列号:
```
adb devices
```
这将列出所有已连接的设备或模拟器的序列号。选择你要连接的设备或模拟器的序列号,并将其替换到上面的命令中即可。
相关问题
error: more than one device/emulator Performing Push Install adb: error: failed to get feature set: more than one device/emulator
这个错误通常是由于同时连接了多个 Android 设备或模拟器导致的。解决方法是使用以下命令之一指定要安装应用程序的设备或模拟器:
1. 使用设备 ID 安装应用程序:
```
adb -s <device_id> install <path_to_apk>
```
2. 使用模拟器名称安装应用程序:
```
adb -s <emulator_name> install <path_to_apk>
```
请将 `<device_id>` 或 `<emulator_name>` 替换为您要安装应用程序的设备或模拟器的 ID 或名称,将 `<path_to_apk>` 替换为您要安装的应用程序的 APK 文件路径。
error: more than one device/emulator
This error message appears when there are multiple devices or emulators connected to the computer at the same time and the command being executed is ambiguous as to which device to target.
To resolve this error, you need to specify which device or emulator to target by using the `-s` flag followed by the device ID or name. For example:
```
adb -s emulator-5554 install myapp.apk
```
This command installs the `myapp.apk` file on the emulator with the ID `emulator-5554`.
To get the list of connected devices and their IDs, you can use the `adb devices` command. This will display a list of all connected devices and emulators along with their unique IDs.
```
adb devices
```
Once you have identified the device or emulator you want to target, use the `-s` flag to specify it in the command.
阅读全文