How to access device back button in Appium latest version 4.0

Hi Everyone,

Please help me to access back button in device. In appium version 2.1.0 i used following line of code


but now i am getting error for send Key Event please tell me how do
i press device back button

You need use driver.pressKeyCode(AndroidKeyCode.BACK)

1 Like