appium运行报错找不到device,使用adb可以启动应用


详细内容:
[ADB] Killing adb server on port 5037

[ADB] Running ‘D:\android-sdk_r24.4.1-windows\android-sdk-windows\platform-tools\adb.exe -P 5037 kill-server’

[ADB] Could not find devices, restarting adb server…

[ADB] Restarting adb

[ADB] Killing adb server on port 5037

[ADB] Running ‘D:\android-sdk_r24.4.1-windows\android-sdk-windows\platform-tools\adb.exe -P 5037 kill-server’

[ADB] Could not find devices, restarting adb server…

[ADB] Restarting adb

[ADB] Killing adb server on port 5037

[ADB] Running ‘D:\android-sdk_r24.4.1-windows\android-sdk-windows\platform-tools\adb.exe -P 5037 kill-server’

[ADB] Could not find devices, restarting adb server…

[ADB] Restarting adb

[ADB] Killing adb server on port 5037

[ADB] Running ‘D:\android-sdk_r24.4.1-windows\android-sdk-windows\platform-tools\adb.exe -P 5037 kill-server’

[ADB] Could not find devices, restarting adb server…

[ADB] Restarting adb

[ADB] Killing adb server on port 5037

[ADB] Running ‘D:\android-sdk_r24.4.1-windows\android-sdk-windows\platform-tools\adb.exe -P 5037 kill-server’

[ADB] Could not find devices, restarting adb server…

[ADB] Restarting adb

[ADB] Killing adb server on port 5037

[ADB] Running ‘D:\android-sdk_r24.4.1-windows\android-sdk-windows\platform-tools\adb.exe -P 5037 kill-server’

[ADB] Could not find devices, restarting adb server…

[ADB] Restarting adb

[ADB] Killing adb server on port 5037

[ADB] Running ‘D:\android-sdk_r24.4.1-windows\android-sdk-windows\platform-tools\adb.exe -P 5037 kill-server’

[ADB] Could not find devices, restarting adb server…

[ADB] Restarting adb

[ADB] Killing adb server on port 5037

[ADB] Running ‘D:\android-sdk_r24.4.1-windows\android-sdk-windows\platform-tools\adb.exe -P 5037 kill-server’

[ADB] Could not find devices, restarting adb server…

[ADB] Restarting adb

[ADB] Killing adb server on port 5037

[ADB] Running ‘D:\android-sdk_r24.4.1-windows\android-sdk-windows\platform-tools\adb.exe -P 5037 kill-server’

[ADB] Could not find devices, restarting adb server…

[ADB] Restarting adb

[ADB] Killing adb server on port 5037

[ADB] Running ‘D:\android-sdk_r24.4.1-windows\android-sdk-windows\platform-tools\adb.exe -P 5037 kill-server’

[UiAutomator2] Deleting UiAutomator2 session

[BaseDriver] Event ‘newSessionStarted’ logged at 1624804473338 (22:34:33 GMT+0800 (中国标准时间))

[MJSONWP] Encountered internal error running command: Error: Could not find a connected Android device.

[MJSONWP] at getDevices (C:\Users\84777\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-adb\lib\tools\system-calls.js:203:13)

[MJSONWP] at getDevices (C:\Users\84777\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-adb\lib\tools\system-calls.js:220:20)

[HTTP] ← POST /wd/hub/session 500 42879 ms - 179

[HTTP]

[HTTP] → DELETE /wd/hub/session


adb可以启动应用,使用Appium Desktop运行后,再用abd启动也提示error: device not found

o(╥﹏╥)o求大佬帮助

1、appium版本多少?
2、JDK版本多少?
3、where adb 看下是不是有多个adb环境

1.appium v1.15.1
2.jdk 1.8
3.C:\Users\84777>where adb
D:\android-sdk_r24.4.1-windows\android-sdk-windows\tools\adb.exe
D:\android-sdk_r24.4.1-windows\android-sdk-windows\platform-tools\adb.exe

先把这个adb移除掉,它跟appium默认去调用的 platform-tools\adb.exe 两个冲突了,互相抢占资源导致你之前在命令行连接的设备被中断掉了

移除后好啦,谢谢 :rofl:

关闭