解决Chromedriver报错Chromedriver exited unexpectedly with code 1, signal null
报错信息如下:
error: Chromedriver: Chromedriver exited unexpectedly with code 1, signal null info: Chromedriver: Changed state to 'stopped' warn: Chromedriver for context WEBVIEW_com.tencent.mm:tools stopped unexpectedly error: Chromedriver quit unexpectedly during session info: --> GET /wd/hub/session/1c76403c-a713-403f-96ac-3e59cfdb7919/source {} info: JSONWP Proxy: Proxying [GET /wd/hub/session/1c76403c-a713-403f-96ac-3e59cf db7919/source] to [GET http://127.0.0.1:9515/wd/hub/session/d7b57614f78bf16972f2 a5bab7a69bf2/source] with body: {} info: JSONWP Proxy: Got response with status 200: {"sessionId":"d7b57614f78bf169 72f2a5bab7a69bf2","status":6,"value":{"message":"no such session\n (Driver info : chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=W indows ... info: JSONWP Proxy: Replacing sessionId d7b57614f78bf16972f2a5bab7a69bf2 with 1c 76403c-a713-403f-96ac-3e59cfdb7919 info: <-- GET /wd/hub/session/1c76403c-a713-403f-96ac-3e59cfdb7919/source 200 22 .285 ms - 218 info: --> GET /wd/hub/session/1c76403c-a713-403f-96ac-3e59cfdb7919/source {} info: JSONWP Proxy: Proxying [GET /wd/hub/session/1c76403c-a713-403f-96ac-3e59cf db7919/source] to [GET http://127.0.0.1:9515/wd/hub/session/d7b57614f78bf16972f2 a5bab7a69bf2/source] with body: {} info: JSONWP Proxy: Got response with status 200: {"sessionId":"d7b57614f78bf169 72f2a5bab7a69bf2","status":6,"value":{"message":"no such session\n (Driver info : chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=W indows ... info: JSONWP Proxy: Replacing sessionId d7b57614f78bf16972f2a5bab7a69bf2 with 1c 76403c-a713-403f-96ac-3e59cfdb7919 info: <-- GET /wd/hub/session/1c76403c-a713-403f-96ac-3e59cfdb7919/source 200 15 .619 ms - 218 info: [debug] Didn't get a new command in 60 secs, shutting down... info: Shutting down appium session info: [debug] Pressing the HOME button info: [debug] executing cmd: D:\Android\sdk\platform-tools\adb.exe -s 7N2TDM158V 040983 shell "input keyevent 3" info: [debug] Resetting IME to 'com.sohu.inputmethod.sogou/.SogouIME' info: [debug] executing cmd: D:\Android\sdk\platform-tools\adb.exe -s 7N2TDM158V 040983 shell "ime set com.sohu.inputmethod.sogou/.SogouIME" info: [debug] Stopping logcat capture info: [debug] Logcat terminated with code null, signal SIGTERM info: [debug] Stopping chromedriver for context WEBVIEW_com.tencent.mm:tools info: Chromedriver: Changed state to 'stopping' info: JSONWP Proxy: Proxying [DELETE /] to [DELETE http://127.0.0.1:9515/wd/hub/ session/d7b57614f78bf16972f2a5bab7a69bf2] with no body info: JSONWP Proxy: Got response with status 200: "{\"sessionId\":\"d7b57614f78b f16972f2a5bab7a69bf2\",\"status\":0,\"value\":null}" error: Chromedriver: Error: Can't stop process; it's not currently running at SubProcess.stop$ (lib/teen_process.js:211:13) at tryCatch (D:\Appium\node_modules\appium\node_modules\appium-chromedriver\ node_modules\teen_process\node_modules\babel-runtime\regenerator\runtime.js:67:4 0) at GeneratorFunctionPrototype.invoke [as _invoke] (D:\Appium\node_modules\ap pium\node_modules\appium-chromedriver\node_modules\teen_process\node_modules\bab el-runtime\regenerator\runtime.js:315:22) at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (D:\A ppium\node_modules\appium\node_modules\appium-chromedriver\node_modules\teen_pro cess\node_modules\babel-runtime\regenerator\runtime.js:100:21) at invoke (D:\Appium\node_modules\appium\node_modules\appium-chromedriver\no de_modules\teen_process\node_modules\babel-runtime\regenerator\runtime.js:136:37 ) at bound (domain.js:250:14) at runBound (domain.js:263:12) at enqueueResult (D:\Appium\node_modules\appium\node_modules\appium-chromedr iver\node_modules\teen_process\node_modules\babel-runtime\regenerator\runtime.js :185:17) at new Promise (D:\Appium\node_modules\appium\node_modules\appium-chromedriv er\node_modules\teen_process\node_modules\babel-runtime\node_modules\core-js\lib rary\modules\es6.promise.js:182:7) at AsyncIterator.enqueue (D:\Appium\node_modules\appium\node_modules\appium- chromedriver\node_modules\teen_process\node_modules\babel-runtime\regenerator\ru ntime.js:184:12) at AsyncIterator.prototype.(anonymous function) [as next] (D:\Appium\node_mo dules\appium\node_modules\appium-chromedriver\node_modules\teen_process\node_mod ules\babel-runtime\regenerator\runtime.js:100:21) at Object.runtime.async (D:\Appium\node_modules\appium\node_modules\appium-c hromedriver\node_modules\teen_process\node_modules\babel-runtime\regenerator\run time.js:209:12) at SubProcess.stop (lib/teen_process.js:209:50) at Chromedriver.stop$ (lib/chromedriver.js:153:23) at tryCatch (D:\Appium\node_modules\appium\node_modules\appium-chromedriver\ node_modules\babel-runtime\regenerator\runtime.js:67:40) at GeneratorFunctionPrototype.invoke [as _invoke] (D:\Appium\node_modules\ap pium\node_modules\appium-chromedriver\node_modules\babel-runtime\regenerator\run time.js:294:22) at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (D:\A ppium\node_modules\appium\node_modules\appium-chromedriver\node_modules\babel-ru ntime\regenerator\runtime.js:100:21) at GeneratorFunctionPrototype.invoke (D:\Appium\node_modules\appium\node_mod ules\appium-chromedriver\node_modules\babel-runtime\regenerator\runtime.js:136:3 7) at bound (domain.js:250:14) at GeneratorFunctionPrototype.runBound (domain.js:263:12) at run (D:\Appium\node_modules\appium\node_modules\appium-chromedriver\node_ modules\babel-runtime\node_modules\core-js\library\modules\es6.promise.js:89:39) at D:\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modul es\babel-runtime\node_modules\core-js\library\modules\es6.promise.js:100:28 at doNTCallback0 (node.js:407:9) at process._tickDomainCallback (node.js:377:13) [Error: Can't stop process; it's not currently running] info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"shutdown"} info: [debug] [BOOTSTRAP] [debug] Got command of type SHUTDOWN info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"OK, shutting down" ,"status":0} info: [debug] [BOOTSTRAP] [debug] Closed client connection info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1 info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=. info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRun ner info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.andro id.bootstrap.Bootstrap info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1 info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 0 info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream= info: [debug] [UIAUTOMATOR STDOUT] Test results for WatcherResultPrinter=. info: [debug] [UIAUTOMATOR STDOUT] Time: 159.225 info: [debug] [UIAUTOMATOR STDOUT] OK (1 test) info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1 info: [debug] Sent shutdown command, waiting for UiAutomator to stop... info: [debug] UiAutomator shut down normally info: [debug] Cleaning up android objects info: [debug] Cleaning up appium session info: [debug] We shut down because no new commands came in
解决办法:
appium命令行指定端口 C:\Users\Administrator>appium --no-reset --port 4735 --bootstrap-port 4736 --udi
d b9979003 --chromedriver-port 8000
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构