本人新手入坑 appium,好不容易装好黄静,昨天测试成功就睡觉了。今天一开机,就连不上了。但是 cmd devices 是可以看到设备的,有大神知道什么原因吗?谢谢!

以下是 appium 运行代码。求大神。呜呜~

[Appium] Welcome to Appium v1.8.0
[Appium] Non-default server args:
[Appium]   address: 127.0.0.1
[Appium] Appium REST http interface listener started on 127.0.0.1:4723
[HTTP] --> POST /wd/hub/session
[HTTP] {"capabilities":{"firstMatch":[{}],"alwaysMatch":{"platformName":"Android"}},"desiredCapabilities":{"platformName":"Android","platformVersion":"5.1.1","deviceName":"127.0.0.1:5555","appPackage":"com.baidu.tieba","appActivity":"com.baidu.tieba.LogoActivity"}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{"platformName":"Android","platformVersion":"5.1.1","deviceName":"127.0.0.1:5555","appPackage":"com.baidu.tieba","appActivity":"com.baidu.tieba.LogoActivity"},null,{"firstMatch":[{}],"alwaysMatch":{"platformName":"Android"}}]
[BaseDriver] Event 'newSessionRequested' logged at 1526153469305 (03:31:09 GMT+0800 (中国标准时间))
[Appium] Could not parse W3C capabilities: 'deviceName' can't be blank. Falling back to JSONWP protocol.
[Appium] The following capabilities were provided in the JSONWP desired capabilities that are missing in W3C capabilities: ["platformName","platformVersion","deviceName","appPackage","appActivity"]. Falling back to JSONWP protocol.
[Appium] Creating new AndroidDriver (v2.6.0) session
[Appium] Capabilities:
[Appium]   platformName: Android
[Appium]   platformVersion: 5.1.1
[Appium]   deviceName: 127.0.0.1:5555
[Appium]   appPackage: com.baidu.tieba
[Appium]   appActivity: com.baidu.tieba.LogoActivity
[BaseDriver] Creating session with MJSONWP desired capabilities: {"platformName":"Android","...
[BaseDriver] Session created with session id: 650fa53c-151b-433b-9d44-3199cdd61a4c
[AndroidDriver] Getting Java version
[AndroidDriver] Java version is: 10.0.1
[ADB] Checking whether adb is present
[ADB] Using adb.exe from F:\ruanjian\android\android-sdk-windows\platform-tools\adb.exe
[AndroidDriver] Retrieving device list
[ADB] Trying to find a connected android device
[ADB] Getting connected devices...
[ADB] Could not find devices, restarting adb server...
[ADB] Restarting adb
[ADB] Killing adb server on port 5037
[ADB] Getting connected devices...
[ADB] Could not find devices, restarting adb server...
[ADB] Restarting adb
[ADB] Killing adb server on port 5037
[ADB] Getting connected devices...
[ADB] Could not find devices, restarting adb server...
[ADB] Restarting adb
[ADB] Killing adb server on port 5037
[ADB] Getting connected devices...
[ADB] Could not find devices, restarting adb server...
[ADB] Restarting adb
[ADB] Killing adb server on port 5037
[ADB] Getting connected devices...
[ADB] Could not find devices, restarting adb server...
[ADB] Restarting adb
[ADB] Killing adb server on port 5037
[ADB] Getting connected devices...
[ADB] Could not find devices, restarting adb server...
[ADB] Restarting adb
[ADB] Killing adb server on port 5037
[AndroidDriver] Shutting down Android driver
[AndroidDriver] Called deleteSession but bootstrap wasn't active
[BaseDriver] Event 'newSessionStarted' logged at 1526153492737 (03:31:32 GMT+0800 (中国标准时间))
[W3C] Encountered internal error running command: Error: Could not find a connected Android device.
[W3C]     at ADB.getDevices$ (C:\Users\ymxz375417299\AppData\Local\Programs\Appium\resources\app\node_modules\appium-adb\lib\tools\system-calls.js:188:13)
[W3C]     at tryCatch (C:\Users\ymxz375417299\AppData\Local\Programs\Appium\resources\app\node_modules\appium-adb\node_modules\babel-runtime\regenerator\runtime.js:67:40)
[W3C]     at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\ymxz375417299\AppData\Local\Programs\Appium\resources\app\node_modules\appium-adb\node_modules\babel-runtime\regenerator\runtime.js:315:22)
[W3C]     at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\ymxz375417299\AppData\Local\Programs\Appium\resources\app\node_modules\appium-adb\node_modules\babel-runtime\regenerator\runtime.js:100:21)
[W3C]     at invoke (C:\Users\ymxz375417299\AppData\Local\Programs\Appium\resources\app\node_modules\appium-adb\node_modules\babel-runtime\regenerator\runtime.js:136:37)
[W3C]     at enqueueResult (C:\Users\ymxz375417299\AppData\Local\Programs\Appium\resources\app\node_modules\appium-adb\node_modules\babel-runtime\regenerator\runtime.js:185:17)
[W3C]     at new Promise ()
[W3C]     at new F (C:\Users\ymxz375417299\AppData\Local\Programs\Appium\resources\app\node_modules\appium-adb\node_modules\core-js\library\modules\$.export.js:30:36)
[W3C]     at AsyncIterator.enqueue (C:\Users\ymxz375417299\AppData\Local\Programs\Appium\resources\app\node_modules\appium-adb\node_modules\babel-runtime\regenerator\runtime.js:184:12)
[W3C]     at AsyncIterator.prototype.(anonymous function) [as next] (C:\Users\ymxz375417299\AppData\Local\Programs\Appium\resources\app\node_modules\appium-adb\node_modules\babel-runtime\regenerator\runtime.js:100:21)
[W3C]     at Object.runtime.async (C:\Users\ymxz375417299\AppData\Local\Programs\Appium\resources\app\node_modules\appium-adb\node_modules\babel-runtime\regenerator\runtime.js:209:12)
[W3C]     at getDevices (C:\Users\ymxz375417299\AppData\Local\Programs\Appium\resources\app\node_modules\appium-adb\build\lib\tools\system-calls.js:402:38)
[W3C]     at ADB.getDevices$ (C:\Users\ymxz375417299\AppData\Local\Programs\Appium\resources\app\node_modules\appium-adb\lib\tools\system-calls.js:205:20)
[W3C]     at tryCatch (C:\Users\ymxz375417299\AppData\Local\Programs\Appium\resources\app\node_modules\appium-adb\node_modules\babel-runtime\regenerator\runtime.js:67:40)
[W3C]     at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\ymxz375417299\AppData\Local\Programs\Appium\resources\app\node_modules\appium-adb\node_modules\babel-runtime\regenerator\runtime.js:315:22)
[W3C]     at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\ymxz375417299\AppData\Local\Programs\Appium\resources\app\node_modules\appium-adb\node_modules\babel-runtime\regenerator\runtime.js:100:21)
[W3C]     at GeneratorFunctionPrototype.invoke (C:\Users\ymxz375417299\AppData\Local\Programs\Appium\resources\app\node_modules\appium-adb\node_modules\babel-runtime\regenerator\runtime.js:136:37)
[W3C]     at 
[HTTP] <-- POST /wd/hub/session 500 23435 ms - 1570
[HTTP] 

我写的测试代码是


↙↙↙阅读原文可查看相关链接,并与作者交流