日志信息如下

2019-12-19 03:11:54:650 [Appium] New AndroidUiautomator2Driver session created successfully, session 8c6afc17-29da-46e9-9a93-1f553e297000 added to master session list
2019-12-19 03:11:54:652 [Appium] Closing session, cause was 'Unexpected shutdown'
2019-12-19 03:11:54:652 [Appium] Removing session 8c6afc17-29da-46e9-9a93-1f553e297000 from our master session list
2019-12-19 03:11:54:654 [BaseDriver] Event 'newSessionStarted' logged at 1576725114653 (11:11:54 GMT+0800 (GMT+08:00))
2019-12-19 03:11:54:656 [W3C (8c6afc17)] Cached the protocol value 'W3C' for the new session 8c6afc17-29da-46e9-9a93-1f553e297000
2019-12-19 03:11:54:657 [W3C (8c6afc17)] Responding to client with driver.createSession() result: {"capabilities":{"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"android","deviceName":"huawei","appPackage":"xxxxxxxxx","appActivity":"xxxxxxxxx.app.home.activity.ActivityFragmentMain","autoGrantPermissions":true},"platformName":"android","deviceName":"emulator-5554","appPackage":"xxxxxxxxx","appActivity":"xxxxxxxxx.app.home.activity.ActivityFragmentMain","autoGrantPermissions":true,"deviceUDID":"emulator-5554","deviceApiLevel":29,"platformVersion":"10","deviceScreenSize":"1080x1920","deviceScreenDensity":420,"deviceModel":"Android SDK built for x86","deviceManufacturer":"Google","pixelRatio":2.625,"statBarHeight":63,"viewportRect":{"left":0,"top":63,"width":1080,"height":1731}}}
2019-12-19 03:11:54:665 [HTTP] <-- POST /wd/hub/session 200 38740 ms - 999
2019-12-19 03:11:54:666 [HTTP]
2019-12-19 03:11:54:669 [HTTP] --> POST /wd/hub/session/8c6afc17-29da-46e9-9a93-1f553e297000/element
2019-12-19 03:11:54:670 [HTTP] {"using":"xpath","value":"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/androidx.drawerlayout.widget.DrawerLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout[1]/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/androidx.recyclerview.widget.RecyclerView/android.widget.RelativeLayout/android.widget.LinearLayout/androidx.recyclerview.widget.RecyclerView/android.widget.LinearLayout[2]/android.widget.RelativeLayout/android.widget.ImageView"}
2019-12-19 03:11:54:722 [W3C (8c6afc17)] Encountered internal error running command: NoSuchDriverError: A session is either terminated or not started
2019-12-19 03:11:54:722 [W3C (8c6afc17)] at asyncHandler (C:\Users\cdliuhuaiyi\AppData\Roaming\npm\node_modules\appium\node_modules_appium-base-driver@4.5.1@appium-base-driver\lib\protocol\protocol.js:252:15)

有没大佬帮忙解决一下


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