appium自动化过程中重启设备后appium进程退出

首先定义好driver
desired_caps = {}
desired_caps[‘platformName’] = ‘Android’
desired_caps[‘deviceName’] = device
driver = webdriver.Remote(‘http://127.0.0.1:4723/wd/hub’, desired_caps)
driver.implicitly_wait(20)
重启设备并等待设备启动后执行元素查找
os.popen(“adb reboot”)
WebDriverWait(driver, time).until(lambda x: x.find_element(by, value))

报错
Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: ‘POST /element’ 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

为什么要重启设备呀,不重启可以执行吗?
贴个完整的appium日志看看

appium-server-logs.txt (169.7 KB)

关闭