首页 > 解决方案 > 运行appium服务器时adb未检测到设备

问题描述

我已经用 tcp 连接了我的设备。它在 adb 设备上显示设备。

adb connect 192.168.0.112
connected to 192.168.0.112:5555

adb devices
List of devices attached 
192.168.0.112:5555  device

但是当 appium 服务器运行时,它无法检测到设备。

[ADB] Using adb from /home/sher/Android/Sdk/platform-tools/adb
[AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected android device
[debug] [ADB] Getting connected devices...
[debug] [ADB] 0 device(s) connected
[debug] [ADB] Could not find devices, restarting adb server...
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [ADB] Getting connected devices...

请人帮忙。我已经坚持了几天。我尝试了很多文章,但没有任何帮助。

标签: androidtcpadbappiumappium-android

解决方案


您应该将原始设备 ID 替换为“ip address:port”组合,然后运行您的测试脚本。在您的情况下(假设它是用 Java 编写的):

capabilities.setCapability("deviceId", "192.168.0.112:5555");

如果这没有帮助,请分享更多详细信息,例如设备功能和测试脚本。


推荐阅读