Call to 'source' failed

[sessionCapabilities()] Error response status: 13, , UnknownError - An unknown server-side error occurred while processing the command. Selenium error: An unknown server-side error occurred while processing the command. Original error: 'GET /' cannot be proxied to UiAutomator2 server because the instrumentation process is not running (probably crashed). Check the server log and/or the logcat output for more details

原因是:多次启动程序且没有关闭驱动,即少写了两行:

desired = {
    "platformName": "Android",
    "platformVersion": "7.1.2",
    "deviceName": "127.0.0.1:62001",
    "appPackage": "com.vphone.launcher",
    "appActivity": "com.vphone.launcher.launcher3.Launcher",
    #这一句不要少
    "automationName": "UiAutomator2"
}
#程序结束不要忘了
driver.quit()