Skip to content

Latest commit

 

History

History
40 lines (28 loc) · 806 Bytes

mobile_methods.md

File metadata and controls

40 lines (28 loc) · 806 Bytes

Cross platform mobile methods

Reset

Mobile reset will reset the app's state.

Ruby + appium_lib gem

mobile :reset

Ruby without the gem

@driver.execute_script 'mobile: reset'

Android mobile methods

KeyEvent

KeyEvent enables sending a keycode to Android.

Press the system menu button in Java.

HashMap<String, Integer> keycode = new HashMap<String, Integer>();
keycode.put("keycode", 82);
driver.executeScript("mobile: keyevent", keycode);

Ruby + appium_lib gem

mobile :keyevent, keycode: 82

Ruby without the gem

@driver.execute_script 'mobile: keyevent', :keycode => 82