HI 求助啊,我目前遇到一个问题 A new session could not be created. 无法联调测试,当我关闭或者打开模拟器都会出现这个错误,单独执行脚本就会报错。
adb 执行确实可以看到的手机
List of devices attached
192.168.56.101:5555 device
appium 也监测到了我手机,但是为什么联调不成功呢,求大神解救啊。
info: Found device 192.168.56.101:5555
info: [debug] Setting device id to 192.168.56.101:5555
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: "D:\Android\sdk\platform-tools\adb.exe" -s 192.168.56.101:5555 wait-for-device
info: [debug] executing cmd: "D:\Android\sdk\platform-tools\adb.exe" -s 192.168.56.101:5555 shell "echo 'ready'"
info: [debug] Starting logcat capture
error: Logcat capture failed: spawn "D:\Android\sdk\platform-tools\adb.exe" ENOENT
info: [debug] Stopping logcat capture
以下是过程 log,写了一个网上看到很简单的 python 测试计算器的脚本,但是出现了一个这么问题,查了好几天没有很好的解决办法。大家有人知道么?info: --> POST /wd/hub/session {"desiredCapabilities":{"deviceName":"Android Emulator","app":"Calculator.apk","platformVersion":"4.4","appPackage":"com.android.calculator2","platformName":"Android","appActivity":".Calculator"}}
info: Client User-Agent string: Python-urllib/2.7
info: [debug] Error: Requested a new session but one was in progress
at [object Object].Appium.start (D:\Appium\node_modules\appium\lib\appium.js:139:15)
at exports.createSession (D:\Appium\node_modules\appium\lib\server\controller.js:188:16)
at Layer.handle as handle_request
at next (D:\Appium\node_modules\appium\node_modules\express\lib\router\route.js:110:13)
at Route.dispatch (D:\Appium\node_modules\appium\node_modules\express\lib\router\route.js:91:3)
at Layer.handle as handle_request
at D:\Appium\node_modules\appium\node_modules\express\lib\router\index.js:267:22
at Function.proto.process_params (D:\Appium\node_modules\appium\node_modules\express\lib\router\index.js:321:12)
at next (D:\Appium\node_modules\appium\node_modules\express\lib\router\index.js:261:10)
at next (D:\Appium\node_modules\appium\node_modules\express\lib\router\route.js14)
at next (D:\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
at next (D:\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
at next (D:\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
at next (D:\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
at next (D:\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
at next (D:\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
at next (D:\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
at next (D:\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
at next (D:\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
at next (D:\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
at D:\Appium\node_modules\appium\lib\server\controller.js:39:7
at Layer.handle as handle_request
at next (D:\Appium\node_modules\appium\node_modules\express\lib\router\route.js:110:13)
at next (D:\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
at next (D:\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
at next (D:\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
at next (D:\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
at next (D:\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
at next (D:\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
at next (D:\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
at next (D:\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
at next (D:\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
at next (D:\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
at next (D:\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
at next (D:\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
at next (D:\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
at next (D:\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
at next (D:\Appium\node_modules\appium\node_modules\express\lib\router\route.js:104:14)
at Route.dispatch (D:\Appium\node_modules\appium\node_modules\express\lib\router\route.js:91:3)
at Layer.handle as handle_request
at D:\Appium\node_modules\appium\node_modules\express\lib\router\index.js:267:22
at Function.proto.process_params (D:\Appium\node_modules\appium\node_modules\express\lib\router\index.js:321:12)
at next (D:\Appium\node_modules\appium\node_modules\express\lib\router\index.js:261:10)
at methodOverride (D:\Appium\node_modules\appium\node_modules\method-override\index.js:79:5)
at Layer.handle as handle_request
at trim_prefix (D:\Appium\node_modules\appium\node_modules\express\lib\router\index.js:302:13)
at D:\Appium\node_modules\appium\node_modules\express\lib\router\index.js:270:7
at Function.proto.process_params (D:\Appium\node_modules\appium\node_modules\express\lib\router\index.js:321:12)
at next (D:\Appium\node_modules\appium\node_modules\express\lib\router\index.js:261:10)
at logger (D:\Appium\node_modules\appium\node_modules\morgan\index.js:136:5)
at Layer.handle as handle_request
at trim_prefix (D:\Appium\node_modules\appium\node_modules\express\lib\router\index.js:302:13)
at D:\Appium\node_modules\appium\node_modules\express\lib\router\index.js:270:7
at Function.proto.process_params (D:\Appium\node_modules\appium\node_modules\express\lib\router\index.js:321:12)
at next (D:\Appium\node_modules\appium\node_modules\express\lib\router\index.js:261:10)
at D:\Appium\node_modules\appium\node_modules\body-parser\lib\read.js:111:5
at done (D:\Appium\node_modules\appium\node_modules\body-parser\node_modules\raw-body\index.js:248:14)
at IncomingMessage.onEnd (D:\Appium\node_modules\appium\node_modules\body-parser\node_modules\raw-body\index.js:294:7)
at IncomingMessage.g (events.js:199:16)
at IncomingMessage.emit (events.js:104:17)
at _stream_readable.js:908:16
at process._tickDomainCallback (node.js:381:11)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Requested a new session but one was in progress)","origValue":"Requested a new session but one was in progress"},"sessionId":"e71830ec-51e9-4e8b-93a4-27b424da5c55"}