Appium server not detecting the device connected through wifi

隐身守侯 提交于 2019-12-13 04:36:14

问题


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.

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)

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

回答1:


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.



来源:https://stackoverflow.com/questions/51438617/appium-server-not-detecting-the-device-connected-through-wifi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!