Add new command to press on the Home button for Android.


The Android UiDevice has method to press the Home button. To support this a new mobile command is added 'home'.

For Java binding, the client code will be...

((JavascriptExecutor)driver).executeScript("mobile: home");

This same functionality can also be achieved with the following client code but the above looks much cleaner.

HashMap<String, Integer> keycode = new HashMap<String, Integer>();
keycode.put("keycode", 3);
((JavascriptExecutor)driver).executeScript("mobile: keyevent", keycode);