利用driver.press_keycode(4) 或者 driver.pressKeyCode(AndroidKeyCode) 報(bào)錯(cuò) 顯示拒絕連接錯(cuò)誤 ConnectionResetError: [Errno 54] Connection reset by peer
找了好久原因也沒找到淑趾,但是adb 命令是能用的 所以用 os 執(zhí)行 adb命令去實(shí)現(xiàn)
mingling = 'adb shell input keyevent KEYCODE_BACK'
os.system(mingling)