Search code examples
androidadb

Android ADB: Simulate Recent App key press


Is there a way to get the use ADB to simulate a Recent App key press? I do not see it in the list of assigned keys and I am not able to select it using adb input shell tap despite getting the coordinates from the debugging options.

I am trying to automate a task on my own personal phone (Nexus 5 with soft keys) so any hacky way is fine, assuming there is not a clean way to do this.


Solution

  • See @SimonMarquis answer below

    adb shell input keyevent KEYCODE_APP_SWITCH
    

    (OBSOLETE)

    I don't think there is a keycode for it.

    However, I am able to open the recent apps menu with adb shell input tap (testing on a Nexus 5 with Lollipop). For example:

    adb shell input tap 800 1890