[UIAutomator2 Error] connect ECONNREFUSED

When test android7.0 with Uiautomator2, error log:
[Appium] Creating new AndroidUiautomator2Driver (v1.12.0) session
[Appium] Capabilities:
[Appium] app: D:/440_P2_nei_update.apk
[Appium] appiumVersion: 1.8.1
[Appium] automationName: Uiautomator2
[Appium] deviceName: P10
[Appium] executionRecordId: 25895
[Appium] host:
[Appium] noReset: true
[Appium] platformName: Android
[Appium] platformVersion: 7.0
[Appium] port: 4724
[Appium] resetKeyboard: true
[Appium] screenHeight: 1920
[Appium] screenWidth: 1080
[Appium] udid: SJE0218201000494
[Appium] unicodeKeyboard: true

[debug] [ADB] Running ‘D:\Program Files (x86)\android-sdk-windows\platform-tools\adb.exe -P 5037
-s SJE0218201000494 shell am force-stop io.appium.uiautomator2.server’
[UiAutomator2] Starting uiautomator2 server 1.12.0
[UiAutomator2] Using UIAutomator2 server from ‘D:\Program Files(x86)\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v1.12.0.apk’ and test from ‘D:\Program Files (x86)\npm\node_modules\appium
[UiAutomator2] Running command: ‘adb -s SJE0218201000494 shell am instrument -w io.appium.uiauto
[UiAutomator2] Waiting up to 20000ms for UiAutomator2 to be online…
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET] with
no body
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET] with
no body
[UiAutomator2] [UIAutomator2 Error] connect ECONNREFUSED
[debug] [UiAutomator2] Full error: Error: connect ECONNREFUSED
[debug] [UiAutomator2] at Object._errnoException (util.js:992:11)
[debug] [UiAutomator2] at _exceptionWithHostPort (util.js:1014:20)
[debug] [UiAutomator2] at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET] with
no body
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET] with
no body
[debug] [UiAutomator2] Deleting UiAutomator2 session
[debug] [UiAutomator2] Deleting UiAutomator2 server session
[UiAutomator2] Did not get confirmation UiAutomator2 deleteSession worked; Error was: Error: Try
ing to proxy a session command without session id
[debug] [UiAutomator2] Resetting IME to ‘com.baidu.input_huawei/.ImeService’
[debug] [ADB] Running ‘D:\Program Files (x86)\android-sdk-windows\platform-tools\adb.exe -P 5037
-s SJE0218201000494 shell ime set com.baidu.input_huawei/.ImeService’
[debug] [ADB] Running ‘D:\Program Files (x86)\android-sdk-windows\platform-tools\adb.exe -P 5037
-s SJE0218201000494 shell am force-stop com.ecitic.bank.mobile’
[debug] [Logcat] Stopping logcat capture
[debug] [ADB] Removing forwarded port socket connection: 8200
[debug] [ADB] Running ‘D:\Program Files (x86)\android-sdk-windows\platform-tools\adb.exe -P 5037
-s SJE0218201000494 forward --remove tcp:8200’
[debug] [BaseDriver] Event ‘newSessionStarted’ logged at 1531816968290 (16:42:48 GMT+0800 (中国标准时
[MJSONWP] Encountered internal error running command: ProxyRequestError: Could not proxy command to remote server. Original error: Error: connect ECONNREFUSED
[MJSONWP] at JWProxy.proxy$ (D:\Program Files (x86)\npm\node_modules\appium\node_modules\app
[MJSONWP] at tryCatch (D:\Program Files (x86)\npm\node_modules\appium\node_modules\babel-run
[MJSONWP] at GeneratorFunctionPrototype.invoke [as _invoke] (D:\Program Files (x86)\npm\node
[MJSONWP] at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (D:\Progra
m Files (x86)\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
[MJSONWP] at GeneratorFunctionPrototype.invoke (D:\Program Files (x86)\npm\node_modules\appi
[HTTP] <-- POST /wd/hub/session 500 120564 ms - 238

I’ve looked at the port occupancy,the 5037 port was occupied by the ADB

[UP] same probleme with 1.9.0