A flow wich kill al the app running in backgroud, possible?

Post your questions and help other users.

Moderator: Martin

Post Reply
wfrcrd
Posts: 116
Joined: 27 May 2015 08:57

A flow wich kill al the app running in backgroud, possible?

Post by wfrcrd » 29 Mar 2016 11:39

My device is rooted and I'd like to perform that action but I don't know how.
There is a complete guide to commands and so on ?

Thank you in advice.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: A flow wich kill al the app running in backgroud, possib

Post by Martin » 29 Mar 2016 18:20

Hi,

You can try action Execute Root Command with command am kill-all. The documentation provided by Google reads:
am kill-all: Kill all background processes.
You can find other interesting stuff by executing command am (without options). I recommend to connect the device to a PC and use adb to experiment with such command line tools. There are other tools available on Android that provide other interesting features: pm, input, svc, dumpsys.

Regards,
Martin

wfrcrd
Posts: 116
Joined: 27 May 2015 08:57

Re: A flow wich kill al the app running in backgroud, possib

Post by wfrcrd » 29 Mar 2016 19:36

Thank you !

wfrcrd
Posts: 116
Joined: 27 May 2015 08:57

Re: A flow wich kill al the app running in backgroud, possib

Post by wfrcrd » 04 Apr 2016 20:21

Im sorry to say that the command don't kill the app (on my rooted device) too bad ...

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: A flow wich kill al the app running in backgroud, possib

Post by Martin » 05 Apr 2016 19:02

Maybe it's not a background process or Android restarts the process. You can use command am force-stop <package> to kill the app.

wfrcrd
Posts: 116
Joined: 27 May 2015 08:57

Re: A flow wich kill al the app running in backgroud, possib

Post by wfrcrd » 06 Apr 2016 09:48

Martin wrote:Maybe it's not a background process or Android restarts the process. You can use command am force-stop <package> to kill the app.
To me still don't work, I have a terminal emulator too: someone can tell me the command to run on a terminal emulator to killa an app?
So I can check if it's a system problem or an app problem.

Thank you !

andy
Posts: 40
Joined: 29 Dec 2014 21:00

Re: A flow wich kill al the app running in backgroud, possib

Post by andy » 06 Apr 2016 16:40

Hi,

Following line is working for me


service call activity 79 s16 <package name>

wfrcrd
Posts: 116
Joined: 27 May 2015 08:57

Re: A flow wich kill al the app running in backgroud, possib

Post by wfrcrd » 06 Apr 2016 17:05

andy wrote:Hi,

Following line is working for me


service call activity 79 s16 <package name>

Thank you , but where are you givin this line ? In a terminal emulator or in a flow ?

What does it means " 79 s16" ?

Thank you

andy
Posts: 40
Joined: 29 Dec 2014 21:00

Re: A flow wich kill al the app running in backgroud, possib

Post by andy » 06 Apr 2016 18:57

I use it in a flow. Create an action for root command. I use it inside my sidebar overlay

I cannot explain what it does. For sure google knows more.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: A flow wich kill al the app running in backgroud, possib

Post by Martin » 06 Apr 2016 19:31

service call activity 79... is probably the same as am force-stop...

activity is the name of the system service. The relevant part of source can be found here: https://android.googlesource.com/platfo ... nager.java
Scroll down to line 544 which reads int FORCE_STOP_PACKAGE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+78;
IBinder.FIRST_CALL_TRANSACTION is 1 + 78 --> 79

am is a utility to call the same functions on the activity manager that are also accessible with service call however am is more stable since Google will ensure that it works on different versions of Android. The number 79 could be wrong on other versions of Android so 79 might suddenly uninstall an app or clear the data.

Post Reply