Appium服务器未检测到通过wifi连接的设备 [英] Appium server not detecting the device connected through wifi

查看:339
本文介绍了Appium服务器未检测到通过wifi连接的设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

分别是adb tcpip 5555adb 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服务器在没有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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆