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
Asked
Active
Viewed 1.3k times
8
-
I believe this is a duplicate of http://stackoverflow.com/questions/3117095/stopping-an-android-app-from-console and that what you are looking for might be
– Lasse Nov 25 '15 at 04:57 -
Okay, the question is same but still I didn't get the exact answer. The one you refer from that, "adb shell pm clear com.my.app.package" commands gets sign out as well, also "adb shell am force-stop com.my.app.package" not take out the app from recent open app list(app switcher). I just want to take out my app from recent app list(which shows in app switcher). ....Is there be specific command which can at least tap on cross icon on the app which is opened in app switcher? – Vaibhav Joshi Nov 25 '15 at 06:13
4 Answers
11
Finally, I got the answer when I tried combining multiple commands:
Open the app switcher
adb shell input keyevent KEYCODE_APP_SWITCHSelect 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)
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.
Ky.
- 28,753
- 48
- 180
- 285
Vaibhav Joshi
- 142
- 3
1
android 5.0 and more
open recent apps
adb shell input keyevent KEYCODE_APP_SWITCH
select app
adb shell input keyevent KEYCODE_DPAD_DOWN
clear from recent apps
adb shell input keyevent DEL
Mustafa SEN
- 11
- 1
0
Here are some tips-
- Open recent apps-
adb shell input keyevent KEYCODE_APP_SWITCHER
- Tap the
cross Xorclose all. Depends on your system UI you need to navigate to it and press enter. For me below worked, you can find what works for your device usingup,down,tabKEYEVENTs.
adb shell input keyevent KEYCODE_DPAD_DOWN
adb shell input keyevent KEYCODE_ENTER
-
This command I tried on my side but seems doesn't response from system side. I couldn't get the reason why it does not worked here. because rest adb commands are working properly. – Vaibhav Joshi Dec 01 '15 at 11:23
-
Even I tried using with the suggested alternatives but still :-( – Vaibhav Joshi Dec 01 '15 at 11:30
-
which command is not working for you ? `APP_SWITCHER` or the below? and which android version you are currently working on? – Rilwan Dec 02 '15 at 03:24
-
The below commands, adb shell input keyevent KEYCODE_DPAD_DOWN adb shell input keyevent KEYCODE_ENTER, Tried with other combinations like, TAB, UP, DOWN, – Vaibhav Joshi Dec 02 '15 at 06:35
-
So app_switcher command is working ? if yes, then you have to see what is the combination to reach close button. – Rilwan Dec 02 '15 at 07:26
0
Thanks to @rilwan for the answer, below command worked for me: First enter into adb shell then execute:
$ adb shell
$ input keyevent KEYCODE_APP_SWITCH && input swipe 522 1647 522 90
or execute at once
$ adb shell input keyevent KEYCODE_APP_SWITCH && input swipe 522 1647 522 90
HackRx
- 120
- 1
- 13