ADB: How to tap/close from recent apps to completelty through ADB one liner command

Vaibhav Joshi picture Vaibhav Joshi · Nov 24, 2015 · Viewed 9.9k times · Source

I have tried multiple commands to close the app from App switcher but didn't through it. I even don't know if there is ány adb command which is persist to close the app from the app switcher. I more Googled for the same and even went through Android but no luck. Does anyone know about this, how to tackle? Kindly suggest our valuable inputs. Thanks in advance

Answer

user2504518 picture user2504518 · Dec 2, 2015

Finally, I got the answer when I tried combining multiple commands:

  1. Open the app switcher

    adb shell input keyevent KEYCODE_APP_SWITCH
    
  2. Select or navigate to the next app in the app switcher

    adb shell input keyevent 20
    ...
    

    (run the above command again for each app down the list)

  3. Remove the app from open app list

    adb shell input keyevent DEL
    

And you are done :-) the app gone out of your open apps list.