Appium 服务器未检测到通过 wifi 连接的设备 [英] Appium server not detecting the device connected through wifi
问题描述
did adb tcpip 5555
和 adb connect ipaddress
.adb devices
显示设备.但是当我运行 appium 服务器时,它显示没有连接 android 设备.
did adb tcpip 5555
and adb connect ipaddress
. The adb devices
show the device. But when i run the appium server, its showing no android device connected.
appium python 代码是
The appium python code is
desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['deviceName'] = 'Android'
desired_caps['automationName'] = 'uiautomator2'
desired_caps['udid'] = 'xx.xx.xx.xx:5555'
desired_caps['platformVersion'] = '6.0.1'
desired_caps['appPackage'] = 'PackageName'
desired_caps['appActivity'] = 'activityName'
driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
appium 服务器错误是
The appium server error is
[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...
[debug] [ADB] 0 device(s) connected
推荐答案
找到了appium不断杀adb服务器的原因并重启了.在此处找到了解决方案.如果 adb server 在没有 root 权限的情况下重启,那么 appium server 将无法再连接到真实设备.使用 sudo
对我有用.
found the reason why appium kept on killing the adb server and restarted it. found the solution here.
If adb server restart without root privilege, then appium Server can't connect to real device anymore.
Using sudo
worked for me.
这篇关于Appium 服务器未检测到通过 wifi 连接的设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!