Appium 描述:appium-desktop 连接真机没有问题,但是连接夜神模拟器会提示:Could not find a connected Android device

浮生洛水 · 2018年09月13日 · 最后由 浮生洛水 回复于 2018年09月18日 · 3020 次阅读

工具版本:
appium-desktop-Setup-1.2.4.exe
夜神模拟器
问题 (现象):
appium-desktop 提示:Could not find a connected Android device
appium-desktop 日志如下:
'''
[info] [Appium] Welcome to Appium v1.7.1[info] [HTTP] --> GET /wd/hub/sessions {}
[debug] [MJSONWP] Calling AppiumDriver.getSessions() with args: []
[debug] [MJSONWP] Responding to client with driver.getSessions() result: []
[info] [HTTP] <-- GET /wd/hub/sessions 200 16 ms - 40 [info] [HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"appActivity":"com.tal.kaoyan.ui.activity.ucenter.LoginActivity","appPackage":"com.tal.kaoyan","deviceName":"127.0.0.1:62001","noReset":true,"platformName":"Android","platformVersion":"4.4.2","newCommandTimeout":0,"connectHardwareKeyboard":true}}
[debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"appActivity":"com.tal.kaoyan.ui.activity.ucenter.LoginActivity","appPackage":"com.tal.kaoyan","deviceName":"127.0.0.1:62001","noReset":true,"platformName":"Android","platformVersion":"4.4.2","newCommandTimeout":0,"connectHardwareKeyboard":true},null,null]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1536743349699 (17:09:09 GMT+0800 (中国标准时间))
[info] [Appium] Creating new AndroidDriver (v1.28.1) session
[info] [Appium] Capabilities:
[info] [Appium] appActivity: 'com.tal.kaoyan.ui.activity.ucenter.LoginActivity'
[info] [Appium] appPackage: 'com.tal.kaoyan'
[info] [Appium] deviceName: '127.0.0.1:62001'
[info] [Appium] noReset: true
[info] [Appium] platformName: 'Android'
[info] [Appium] platformVersion: '4.4.2'
[info] [Appium] newCommandTimeout: 0
[info] [Appium] connectHardwareKeyboard: true
[warn] [BaseDriver] The following capabilities were provided, but are not recognized by appium: connectHardwareKeyboard.
[info] [BaseDriver] Session created with session id: b70677f2-cec1-434a-810c-55a1c28f04ff
[debug] [AndroidDriver] Getting Java version[info] [AndroidDriver] Java version is: 1.8.0_161
[info] [ADB] Checking whether adb is present
[info] [ADB] Using adb.exe from D:\android-sdk\platform-tools\adb.exe
[info] [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
[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
[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
[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
[debug] [ADB] Could not find devices, restarting adb server...
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037[debug] [ADB] Could not find devices, restarting adb server...
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037[debug] [ADB] Could not find devices, restarting adb server...
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037[debug] [ADB] Could not find devices, restarting adb server...
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037[debug] [ADB] Could not find devices, restarting adb server...
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037[debug] [ADB] Could not find devices, restarting adb server...
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037[debug] [AndroidDriver] Shutting down Android driver
[debug] [AndroidDriver] Called deleteSession but bootstrap wasn't active
[error] [MJSONWP] Encountered internal error running command: Error: Could not find a connected Android device.
at ADB.getDevices$ (C:\Users\Administrator\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\appium-adb\lib\tools\system-calls.js:187:13)
at tryCatch (C:\Users\Administrator\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as next
at invoke (C:\Users\Administrator\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
at enqueueResult (C:\Users\Administrator\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:185:17)
at Promise.F (C:\Users\Administrator\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\core-js\library\modules\$.export.js:30:36)
at AsyncIterator.enqueue (C:\Users\Administrator\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:184:12)
at AsyncIterator.prototype.(anonymous function) as next
at Object.runtime.async (C:\Users\Administrator\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:209:12)
at getDevices (C:\Users\Administrator\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\appium-adb\build\lib\tools\system-calls.js:435:38)
at ADB.getDevices$ (C:\Users\Administrator\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\appium-adb\lib\tools\system-calls.js:204:20)
at tryCatch (C:\Users\Administrator\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as next
at GeneratorFunctionPrototype.invoke (C:\Users\Administrator\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
[info] [HTTP] <-- POST /wd/hub/session 500 30459 ms - 179 [info] [HTTP] --> DELETE /wd/hub/session {}
[debug] [HTTP] No route found. Setting content type to 'text/plain'
[info] [HTTP] <-- DELETE /wd/hub/session 404 16 ms - 57
'''

最佳回复

此问题是 appium 的环境版本兼容的问题,按以下链接配置环境就行了。
appium 环境搭建
链接 https://www.cnblogs.com/luoshuifusheng/p/9621670.html

共收到 2 条回复 时间 点赞

adb devices

此问题是 appium 的环境版本兼容的问题,按以下链接配置环境就行了。
appium 环境搭建
链接 https://www.cnblogs.com/luoshuifusheng/p/9621670.html

浮生洛水 关闭了讨论 09月18日 08:54
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册