n unexpected response with status undefined: {“code”:“ECONNRESET”}** [debug] [W3C (2c95e33b)] Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command.

appium 运行到一半的时候就提示an unexpected response with status undefined: {“code”:“ECONNRESET”}** [debug] [W3C (2c95e33b)] Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: socket hang up

1、如下是运行环境:
window10
mumu模拟器 ,安卓版本 6.0.1
appium版本 1.15.1

2、日志
[debug] [W3C (2c95e33b)] Calling AppiumDriver.findElement() with args: [“id”,“com.tencent.wework:id/er6”,“2c95e33b-52e6-414f-90a6-b0bf7e10390f”]
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[debug] [BaseDriver] Waiting up to 10000 ms for condition
[debug] [WD Proxy] Matched ‘/element’ to command name ‘findElement’
[debug] [WD Proxy] Proxying [POST /element] to [POST http://localhost:8202/wd/hub/session/9b8ef7c7-1d5a-4b22-9fe0-a9f57c7d4c31/element] with body: {“strategy”:“id”,“selector”:“com.tencent.wework:id/er6”,“context”:“”,“multiple”:false}
[debug] [WD Proxy] Got response with status 200: {“sessionId”:“9b8ef7c7-1d5a-4b22-9fe0-a9f57c7d4c31”,“value”:{“ELEMENT”:“ac592490-5516-4b06-acd8-05d7659a91d7”,“element-6066-11e4-a52e-4f735466cecf”:“ac592490-5516-4b06-acd8-05d7659a91d7”}}
[debug] [W3C (2c95e33b)] Responding to client with driver.findElement() result: {“element-6066-11e4-a52e-4f735466cecf”:“ac592490-5516-4b06-acd8-05d7659a91d7”,“ELEMENT”:“ac592490-5516-4b06-acd8-05d7659a91d7”}
[HTTP] ← POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/element 200 28 ms - 137
[HTTP]
[HTTP] → POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/timeouts
[HTTP] {“implicit”:10000}
[debug] [W3C (2c95e33b)] Calling AppiumDriver.timeouts() with args: [null,null,null,null,10000,“2c95e33b-52e6-414f-90a6-b0bf7e10390f”]
[debug] [BaseDriver] W3C timeout argument: {“implicit”:10000}}
[debug] [BaseDriver] Set implicit wait to 10000ms
[debug] [W3C (2c95e33b)] Responding to client with driver.timeouts() result: null
[HTTP] ← POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/timeouts 200 3 ms - 14
[HTTP]
[HTTP] → POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/element/ac592490-5516-4b06-acd8-05d7659a91d7/value
[HTTP] {“text”:“17557663094”,“value”:[“1”,“7”,“5”,“5”,“7”,“6”,“6”,“3”,“0”,“9”,“4”],“id”:“ac592490-5516-4b06-acd8-05d7659a91d7”}
[debug] [W3C (2c95e33b)] Calling AppiumDriver.setValue() with args: [[“1”,“7”,“5”,“5”,“7”,“6”,“6”,“3”,“0”,“9”,“4”],“ac592490-5516-4b06-acd8-05d7659a91d7”,“2c95e33b-52e6-414f-90a6-b0bf7e10390f”]
[debug] [WD Proxy] Matched ‘/element/ac592490-5516-4b06-acd8-05d7659a91d7/value’ to command name ‘setValue’
[debug] [Protocol Converter] Added ‘value’ property [“1”,“7”,“5”,“5”,“7”,“6”,“6”,“3”,“0”,“9”,“4”] to ‘setValue’ request body
[debug] [WD Proxy] Proxying [POST /element/ac592490-5516-4b06-acd8-05d7659a91d7/value] to [POST http://localhost:8202/wd/hub/session/9b8ef7c7-1d5a-4b22-9fe0-a9f57c7d4c31/element/ac592490-5516-4b06-acd8-05d7659a91d7/value] with body: {“elementId”:“ac592490-5516-4b06-acd8-05d7659a91d7”,“text”:“17557663094”,“replace”:false,“value”:[“1”,“7”,“5”,“5”,“7”,“6”,“6”,“3”,“0”,“9”,“4”]}
[debug] [WD Proxy] Got response with status 200: {“sessionId”:“9b8ef7c7-1d5a-4b22-9fe0-a9f57c7d4c31”,“value”:null}
[debug] [W3C (2c95e33b)] Responding to client with driver.setValue() result: null
[HTTP] ← POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/element/ac592490-5516-4b06-acd8-05d7659a91d7/value 200 523 ms - 14
[HTTP]
[HTTP] → POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/element
[HTTP] {“using”:“id”,“value”:“com.tencent.wework:id/gvy”}
[debug] [W3C (2c95e33b)] Calling AppiumDriver.findElement() with args: [“id”,“com.tencent.wework:id/gvy”,“2c95e33b-52e6-414f-90a6-b0bf7e10390f”]
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[debug] [BaseDriver] Waiting up to 10000 ms for condition
[debug] [WD Proxy] Matched ‘/element’ to command name ‘findElement’
[debug] [WD Proxy] Proxying [POST /element] to [POST http://localhost:8202/wd/hub/session/9b8ef7c7-1d5a-4b22-9fe0-a9f57c7d4c31/element] with body: {“strategy”:“id”,“selector”:“com.tencent.wework:id/gvy”,“context”:“”,“multiple”:false}
[debug] [WD Proxy] Got response with status 200: {“sessionId”:“9b8ef7c7-1d5a-4b22-9fe0-a9f57c7d4c31”,“value”:{“ELEMENT”:“6c7a23f0-c092-4ce0-82e7-ba0a2ac34609”,“element-6066-11e4-a52e-4f735466cecf”:“6c7a23f0-c092-4ce0-82e7-ba0a2ac34609”}}
[debug] [W3C (2c95e33b)] Responding to client with driver.findElement() result: {“element-6066-11e4-a52e-4f735466cecf”:“6c7a23f0-c092-4ce0-82e7-ba0a2ac34609”,“ELEMENT”:“6c7a23f0-c092-4ce0-82e7-ba0a2ac34609”}
[HTTP] ← POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/element 200 507 ms - 137
[HTTP]
[HTTP] → POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/timeouts
[HTTP] {“implicit”:10000}
[debug] [W3C (2c95e33b)] Calling AppiumDriver.timeouts() with args: [null,null,null,null,10000,“2c95e33b-52e6-414f-90a6-b0bf7e10390f”]
[debug] [BaseDriver] W3C timeout argument: {“implicit”:10000}}
[debug] [BaseDriver] Set implicit wait to 10000ms
[debug] [W3C (2c95e33b)] Responding to client with driver.timeouts() result: null
[HTTP] ← POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/timeouts 200 3 ms - 14
[HTTP]
[HTTP] → POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/element/6c7a23f0-c092-4ce0-82e7-ba0a2ac34609/click
[HTTP] {“id”:“6c7a23f0-c092-4ce0-82e7-ba0a2ac34609”}
[debug] [W3C (2c95e33b)] Calling AppiumDriver.click() with args: [“6c7a23f0-c092-4ce0-82e7-ba0a2ac34609”,“2c95e33b-52e6-414f-90a6-b0bf7e10390f”]
[debug] [WD Proxy] Matched ‘/element/6c7a23f0-c092-4ce0-82e7-ba0a2ac34609/click’ to command name ‘click’
[debug] [WD Proxy] Proxying [POST /element/6c7a23f0-c092-4ce0-82e7-ba0a2ac34609/click] to [POST http://localhost:8202/wd/hub/session/9b8ef7c7-1d5a-4b22-9fe0-a9f57c7d4c31/element/6c7a23f0-c092-4ce0-82e7-ba0a2ac34609/click] with body: {“element”:“6c7a23f0-c092-4ce0-82e7-ba0a2ac34609”}
[debug] [WD Proxy] Got response with status 200: {“sessionId”:“9b8ef7c7-1d5a-4b22-9fe0-a9f57c7d4c31”,“value”:null}
[debug] [W3C (2c95e33b)] Responding to client with driver.click() result: null
[HTTP] ← POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/element/6c7a23f0-c092-4ce0-82e7-ba0a2ac34609/click 200 17 ms - 14
[HTTP]
[HTTP] → POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/element
[HTTP] {“using”:“xpath”,“value”:“//[@class=‘android.widget.Toast’]“}
[debug] [W3C (2c95e33b)] Calling AppiumDriver.findElement() with args: [“xpath”,”//
[@class=‘android.widget.Toast’]”,“2c95e33b-52e6-414f-90a6-b0bf7e10390f”]
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[debug] [BaseDriver] Waiting up to 10000 ms for condition
[debug] [WD Proxy] Matched ‘/element’ to command name ‘findElement’
[debug] [WD Proxy] Proxying [POST /element] to [POST http://localhost:8202/wd/hub/session/9b8ef7c7-1d5a-4b22-9fe0-a9f57c7d4c31/element] with body: {“strategy”:“xpath”,“selector”:“//[@class=‘android.widget.Toast’]“,“context”:”“,“multiple”:false}
[debug] [WD Proxy] Got response with status 200: {“sessionId”:“9b8ef7c7-1d5a-4b22-9fe0-a9f57c7d4c31”,“value”:{“ELEMENT”:“1b1acf0f-c0fe-427b-a73f-75994c7e3b7a”,“element-6066-11e4-a52e-4f735466cecf”:“1b1acf0f-c0fe-427b-a73f-75994c7e3b7a”}}
[debug] [W3C (2c95e33b)] Responding to client with driver.findElement() result: {“element-6066-11e4-a52e-4f735466cecf”:“1b1acf0f-c0fe-427b-a73f-75994c7e3b7a”,“ELEMENT”:“1b1acf0f-c0fe-427b-a73f-75994c7e3b7a”}
[HTTP] ← POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/element 200 104 ms - 137
[HTTP]
[HTTP] → GET /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/element/1b1acf0f-c0fe-427b-a73f-75994c7e3b7a/text
[HTTP] {}
[W3C (2c95e33b)] Driver proxy active, passing request on via HTTP proxy
[debug] [WD Proxy] Matched ‘/wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/element/1b1acf0f-c0fe-427b-a73f-75994c7e3b7a/text’ to command name ‘getText’
[debug] [WD Proxy] Proxying [GET /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/element/1b1acf0f-c0fe-427b-a73f-75994c7e3b7a/text] to [GET http://localhost:8202/wd/hub/session/9b8ef7c7-1d5a-4b22-9fe0-a9f57c7d4c31/element/1b1acf0f-c0fe-427b-a73f-75994c7e3b7a/text] with body: {}
[debug] [WD Proxy] Got response with status 200: {“sessionId”:“9b8ef7c7-1d5a-4b22-9fe0-a9f57c7d4c31”,“value”:“添加成功”}
[WD Proxy] Replacing sessionId 9b8ef7c7-1d5a-4b22-9fe0-a9f57c7d4c31 with 2c95e33b-52e6-414f-90a6-b0bf7e10390f
[HTTP] ← GET /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/element/1b1acf0f-c0fe-427b-a73f-75994c7e3b7a/text 200 44 ms - 75
[HTTP]
[HTTP] → POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/element
[HTTP] {“using”:“id”,“value”:“com.tencent.wework:id/gvg”}
[debug] [W3C (2c95e33b)] Calling AppiumDriver.findElement() with args: [“id”,“com.tencent.wework:id/gvg”,“2c95e33b-52e6-414f-90a6-b0bf7e10390f”]
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[debug] [BaseDriver] Waiting up to 10000 ms for condition
[debug] [WD Proxy] Matched ‘/element’ to command name ‘findElement’
[debug] [WD Proxy] Proxying [POST /element] to [POST http://localhost:8202/wd/hub/session/9b8ef7c7-1d5a-4b22-9fe0-a9f57c7d4c31/element] with body: {“strategy”:“id”,“selector”:“com.tencent.wework:id/gvg”,“context”:”“,“multiple”:false}
[debug] [WD Proxy] Got response with status 200: {“sessionId”:“9b8ef7c7-1d5a-4b22-9fe0-a9f57c7d4c31”,“value”:{“ELEMENT”:“cf1ddcb7-a986-4334-9d53-209fa98ccdf6”,“element-6066-11e4-a52e-4f735466cecf”:“cf1ddcb7-a986-4334-9d53-209fa98ccdf6”}}
[debug] [W3C (2c95e33b)] Responding to client with driver.findElement() result: {“element-6066-11e4-a52e-4f735466cecf”:“cf1ddcb7-a986-4334-9d53-209fa98ccdf6”,“ELEMENT”:“cf1ddcb7-a986-4334-9d53-209fa98ccdf6”}
[HTTP] ← POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/element 200 20 ms - 137
[HTTP]
[HTTP] → POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/timeouts
[HTTP] {“implicit”:10000}
[debug] [W3C (2c95e33b)] Calling AppiumDriver.timeouts() with args: [null,null,null,null,10000,“2c95e33b-52e6-414f-90a6-b0bf7e10390f”]
[debug] [BaseDriver] W3C timeout argument: {“implicit”:10000}}
[debug] [BaseDriver] Set implicit wait to 10000ms
[debug] [W3C (2c95e33b)] Responding to client with driver.timeouts() result: null
[HTTP] ← POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/timeouts 200 3 ms - 14
[HTTP]
[HTTP] → POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/element/cf1ddcb7-a986-4334-9d53-209fa98ccdf6/click
[HTTP] {“id”:“cf1ddcb7-a986-4334-9d53-209fa98ccdf6”}
[debug] [W3C (2c95e33b)] Calling AppiumDriver.click() with args: [“cf1ddcb7-a986-4334-9d53-209fa98ccdf6”,“2c95e33b-52e6-414f-90a6-b0bf7e10390f”]
[debug] [WD Proxy] Matched ‘/element/cf1ddcb7-a986-4334-9d53-209fa98ccdf6/click’ to command name ‘click’
[debug] [WD Proxy] Proxying [POST /element/cf1ddcb7-a986-4334-9d53-209fa98ccdf6/click] to [POST http://localhost:8202/wd/hub/session/9b8ef7c7-1d5a-4b22-9fe0-a9f57c7d4c31/element/cf1ddcb7-a986-4334-9d53-209fa98ccdf6/click] with body: {“element”:“cf1ddcb7-a986-4334-9d53-209fa98ccdf6”}
[debug] [WD Proxy] Got response with status 200: {“sessionId”:“9b8ef7c7-1d5a-4b22-9fe0-a9f57c7d4c31”,“value”:null}
[debug] [W3C (2c95e33b)] Responding to client with driver.click() result: null
[HTTP] ← POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/element/cf1ddcb7-a986-4334-9d53-209fa98ccdf6/click 200 16 ms - 14
[HTTP]
[HTTP] → POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/element
[HTTP] {“using”:“xpath”,“value”:”//
[@text=‘消息’]”}
[debug] [W3C (2c95e33b)] Calling AppiumDriver.findElement() with args: [“xpath”,“//[@text=‘消息’]“,“2c95e33b-52e6-414f-90a6-b0bf7e10390f”]
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[debug] [BaseDriver] Waiting up to 10000 ms for condition
[debug] [WD Proxy] Matched ‘/element’ to command name ‘findElement’
[debug] [WD Proxy] Proxying [POST /element] to [POST http://localhost:8202/wd/hub/session/9b8ef7c7-1d5a-4b22-9fe0-a9f57c7d4c31/element] with body: {“strategy”:“xpath”,“selector”:”//
[@text=‘消息’]”,“context”:“”,“multiple”:false}
[BaseDriver] Shutting down because we waited 60 seconds for a command
[debug] [UiAutomator2] Deleting UiAutomator2 session
[Appium] Closing session, cause was ‘New Command Timeout of 60 seconds expired. Try customizing the timeout using the ‘newCommandTimeout’ desired capability’
[Appium] Removing session 16542469-5feb-45e3-b608-de789bd3945e from our master session list
[debug] [UiAutomator2] Deleting UiAutomator2 server session
[debug] [WD Proxy] Matched ‘/’ to command name ‘deleteSession’
[debug] [WD Proxy] Proxying [DELETE /] to [DELETE http://localhost:8201/wd/hub/session/677a658a-2176-410a-97db-9e82223c1719] with no body
[debug] [WD Proxy] Got response with status 200: {“sessionId”:“677a658a-2176-410a-97db-9e82223c1719”,“value”:null}
[debug] [ADB] Running ‘D:\Program Files (x86)\appium\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1:7555 shell am force-stop com.tencent.wework’
[debug] [Instrumentation] .
[debug] [Instrumentation] Time: 47.074
[debug] [Instrumentation]
[debug] [Instrumentation] OK (1 test)
[WD Proxy] Got an unexpected response with status undefined: {“code”:“ECONNRESET”}
[debug] [W3C (2c95e33b)] Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: socket hang up
[debug] [W3C (2c95e33b)] at JWProxy.command (C:\Users\lnz\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\jsonwp-proxy\proxy.js:261:13)
[HTTP] ← POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/element 500 3150 ms - 560
[HTTP]
[HTTP] → POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/timeouts
[HTTP] {“implicit”:1000}
[debug] [W3C (2c95e33b)] Calling AppiumDriver.timeouts() with args: [null,null,null,null,1000,“2c95e33b-52e6-414f-90a6-b0bf7e10390f”]
[debug] [BaseDriver] W3C timeout argument: {“implicit”:1000}}
[debug] [BaseDriver] Set implicit wait to 1000ms
[debug] [W3C (2c95e33b)] Responding to client with driver.timeouts() result: null
[HTTP] ← POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/timeouts 200 3 ms - 14
[HTTP]
[HTTP] → POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/elements
[HTTP] {“using”:“xpath”,“value”:“//[@text=‘确认’]“}
[debug] [W3C (2c95e33b)] Calling AppiumDriver.findElements() with args: [“xpath”,”//
[@text=‘确认’]”,“2c95e33b-52e6-414f-90a6-b0bf7e10390f”]
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[debug] [BaseDriver] Waiting up to 1000 ms for condition
[debug] [WD Proxy] Matched ‘/elements’ to command name ‘findElements’
[debug] [WD Proxy] Proxying [POST /elements] to [POST http://localhost:8202/wd/hub/session/9b8ef7c7-1d5a-4b22-9fe0-a9f57c7d4c31/elements] with body: {“strategy”:“xpath”,“selector”:“//[@text=‘确认’]“,“context”:”“,“multiple”:true}
[WD Proxy] Got an unexpected response with status undefined: {“code”:“ECONNRESET”}
[debug] [W3C (2c95e33b)] Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: socket hang up
[debug] [W3C (2c95e33b)] at JWProxy.command (C:\Users\lnz\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\jsonwp-proxy\proxy.js:261:13)
[HTTP] ← POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/elements 500 17 ms - 560
[HTTP]
[debug] [Logcat] Stopping logcat capture
[debug] [ADB] Removing forwarded port socket connection: 8201
[debug] [ADB] Running ‘D:\Program Files (x86)\appium\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1:7555 forward --remove tcp:8201’
[debug] [Instrumentation] The process has exited with code 0
[HTTP] → POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/element
[HTTP] {“using”:“xpath”,“value”:”//
[@text=‘通讯录’]”}
[debug] [W3C (2c95e33b)] Calling AppiumDriver.findElement() with args: [“xpath”,“//[@text=‘通讯录’]“,“2c95e33b-52e6-414f-90a6-b0bf7e10390f”]
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[debug] [BaseDriver] Waiting up to 1000 ms for condition
[debug] [WD Proxy] Matched ‘/element’ to command name ‘findElement’
[debug] [WD Proxy] Proxying [POST /element] to [POST http://localhost:8202/wd/hub/session/9b8ef7c7-1d5a-4b22-9fe0-a9f57c7d4c31/element] with body: {“strategy”:“xpath”,“selector”:”//
[@text=‘通讯录’]”,“context”:“”,“multiple”:false}
[WD Proxy] Got an unexpected response with status undefined: {“code”:“ECONNRESET”}
[debug] [W3C (2c95e33b)] Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: socket hang up
[debug] [W3C (2c95e33b)] at JWProxy.command (C:\Users\lnz\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\jsonwp-proxy\proxy.js:261:13)
[HTTP] ← POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/element 500 12 ms - 560
[HTTP]
[HTTP] → POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/timeouts
[HTTP] {“implicit”:1000}
[debug] [W3C (2c95e33b)] Calling AppiumDriver.timeouts() with args: [null,null,null,null,1000,“2c95e33b-52e6-414f-90a6-b0bf7e10390f”]
[debug] [BaseDriver] W3C timeout argument: {“implicit”:1000}}
[debug] [BaseDriver] Set implicit wait to 1000ms
[debug] [W3C (2c95e33b)] Responding to client with driver.timeouts() result: null
[HTTP] ← POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/timeouts 200 4 ms - 14
[HTTP]
[HTTP] → POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/elements
[HTTP] {“using”:“xpath”,“value”:“//[@text=‘确认’]“}
[debug] [W3C (2c95e33b)] Calling AppiumDriver.findElements() with args: [“xpath”,”//
[@text=‘确认’]”,“2c95e33b-52e6-414f-90a6-b0bf7e10390f”]
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[debug] [BaseDriver] Waiting up to 1000 ms for condition
[debug] [WD Proxy] Matched ‘/elements’ to command name ‘findElements’
[debug] [WD Proxy] Proxying [POST /elements] to [POST http://localhost:8202/wd/hub/session/9b8ef7c7-1d5a-4b22-9fe0-a9f57c7d4c31/elements] with body: {“strategy”:“xpath”,“selector”:“//[@text=‘确认’]“,“context”:”“,“multiple”:true}
[WD Proxy] Got an unexpected response with status undefined: {“code”:“ECONNRESET”}
[debug] [W3C (2c95e33b)] Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: socket hang up
[debug] [W3C (2c95e33b)] at JWProxy.command (C:\Users\lnz\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\jsonwp-proxy\proxy.js:261:13)
[HTTP] ← POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/elements 500 15 ms - 560
[HTTP]
[HTTP] → POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/element
[HTTP] {“using”:“xpath”,“value”:”//
[@text=‘消息’]”}
[debug] [W3C (2c95e33b)] Calling AppiumDriver.findElement() with args: [“xpath”,“//[@text=‘消息’]“,“2c95e33b-52e6-414f-90a6-b0bf7e10390f”]
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[debug] [BaseDriver] Waiting up to 1000 ms for condition
[debug] [WD Proxy] Matched ‘/element’ to command name ‘findElement’
[debug] [WD Proxy] Proxying [POST /element] to [POST http://localhost:8202/wd/hub/session/9b8ef7c7-1d5a-4b22-9fe0-a9f57c7d4c31/element] with body: {“strategy”:“xpath”,“selector”:”//
[@text=‘消息’]”,“context”:“”,“multiple”:false}
[WD Proxy] Got an unexpected response with status undefined: {“code”:“ECONNRESET”}
[debug] [W3C (2c95e33b)] Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: socket hang up
[debug] [W3C (2c95e33b)] at JWProxy.command (C:\Users\lnz\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\jsonwp-proxy\proxy.js:261:13)
[HTTP] ← POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/element 500 9 ms - 560
[HTTP]
[HTTP] → POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/timeouts
[HTTP] {“implicit”:1000}
[debug] [W3C (2c95e33b)] Calling AppiumDriver.timeouts() with args: [null,null,null,null,1000,“2c95e33b-52e6-414f-90a6-b0bf7e10390f”]
[debug] [BaseDriver] W3C timeout argument: {“implicit”:1000}}
[debug] [BaseDriver] Set implicit wait to 1000ms
[debug] [W3C (2c95e33b)] Responding to client with driver.timeouts() result: null
[HTTP] ← POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/timeouts 200 3 ms - 14
[HTTP]
[HTTP] → POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/elements
[HTTP] {“using”:“xpath”,“value”:“//[@text=‘确认’]“}
[debug] [W3C (2c95e33b)] Calling AppiumDriver.findElements() with args: [“xpath”,”//
[@text=‘确认’]”,“2c95e33b-52e6-414f-90a6-b0bf7e10390f”]
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[debug] [BaseDriver] Waiting up to 1000 ms for condition
[debug] [WD Proxy] Matched ‘/elements’ to command name ‘findElements’
[debug] [WD Proxy] Proxying [POST /elements] to [POST http://localhost:8202/wd/hub/session/9b8ef7c7-1d5a-4b22-9fe0-a9f57c7d4c31/elements] with body: {“strategy”:“xpath”,“selector”:“//*[@text=‘确认’]”,“context”:“”,“multiple”:true}
[WD Proxy] Got an unexpected response with status undefined: {“code”:“ECONNRESET”}
[debug] [W3C (2c95e33b)] Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: socket hang up
[debug] [W3C (2c95e33b)] at JWProxy.command (C:\Users\lnz\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\jsonwp-proxy\proxy.js:261:13)
[HTTP] ← POST /wd/hub/session/2c95e33b-52e6-414f-90a6-b0bf7e10390f/elements 500 12 ms - 560

我尝试了再次运行1次代码此问题,又不会出现此问题了 ;我想知道这个问题解决的终极方案是什么?

[BaseDriver] Shutting down because we waited 60 seconds for a command
[debug] [UiAutomator2] Deleting UiAutomator2 session
[Appium] Closing session, cause was ‘New Command Timeout of 60 seconds expired. Try customizing the timeout using the ‘newCommandTimeout’ desired capability’
[Appium] Removing session 16542469-5feb-45e3-b608-de789bd3945e from our master session list
[debug] [UiAutomator2] Deleting UiAutomator2 server session

从log中看到有一个超时退出,但是查看sessionID与你之前发送消息的ID并不相符,判断应该是你上一次appium执行没有正常的退出,所以上一次启动的session一直在等待没有结束,在你这次运行到一半的时候,上次的session等待时间到了60秒没有收到消息,达到了退出条件自动退出,自动退出时破坏了你当前正在运行的状态,导致你的运行报错中断。

好的,谢谢老师