首页 新闻 会员 周边 捐助

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

-1
[已解决问题] 解决于 2018-09-18 08:51

1、工具版本:

appium-desktop-Setup-1.2.4.exe
夜神模拟器

2、问题(现象):

appium-desktop提示:Could not find a connected Android device

3、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] (C:\Users\Administrator\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\Administrator\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
    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] (C:\Users\Administrator\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
    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] (C:\Users\Administrator\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\Administrator\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
    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 
帅强测试开发之路的主页 帅强测试开发之路 | 菜鸟二级 | 园豆:206
提问于:2018-09-12 17:35
< >
分享
最佳答案
1

adb devices 能看到设备吗
原理上是可通的 还是要检查夜神模拟器和adb版本
Appium 链接夜神模拟器

奖励园豆:5
ycyzharry | 高人七级 |园豆:25683 | 2018-09-12 17:45

我的adb是1.0.40,并且把夜神的nox_adb.exe替换了(已重命名了)
adb devices 也能看到设备。
还是出现以上错误

帅强测试开发之路 | 园豆:206 (菜鸟二级) | 2018-09-12 18:11
其他回答(2)
0

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

帅强测试开发之路 | 园豆:206 (菜鸟二级) | 2018-09-18 08:50
0

问题解决了嘛?

我有会飞的本事儿 | 园豆:29 (初学一级) | 2020-04-10 18:25
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册