Kill app vs kill app process

General discussions about Automagic and automation in general

Moderator: Martin

Post Reply
mmplx
Posts: 5
Joined: 11 Mar 2017 12:40

Kill app vs kill app process

Post by mmplx » 13 Mar 2017 03:36

Hi all, the description of Kill App states that "The action Kill App kills the *processes*", but instead Kill App Process is only available when the device is rooted. Moreover, after executing Kill App memory is released but the Force Stop button of the app is not greyed out as disabled, so it seems to me that the app wasn't really killed, maybe Kill App Process would have completely killed the app (I cannot test that since I've no root access). Could you please clarify the difference? I want to stop some apps on doze, for example Netflix and Google Play Store that tend to produce many wakelocks when the device is idle, but I'm not getting the desired result by executing Kill App. Regards, Carlos.

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

Re: Kill app vs kill app process

Post by Martin » 14 Mar 2017 09:07

Hi,

Kill App is used to ask Android to kill background processes that are currently not of much use. The operating system usually just kills/stops apps and services in background (not visible and not showing a special foreground-notification like an active audio player). Android will restart the app when required, e.g. when the app asked the system to be part of the synchronization feature.

Kill App Process attempts to identify the process ID on it's own and sends the selected signal to the app (usually TERM or KILL). It's using the usual kill command available on linux machines to send the signal to the process. Android often restarts processes after a short while when the app asked the system to always run in the background.

If you really want to stop an app, you can also use Execute Root Command: am force-stop <package> which requires a rooted device but is the same like pressing the force stop button in system settings->Apps->App.

Regards,
Martin

thewild
Posts: 12
Joined: 10 Mar 2017 10:13

Re: Kill app vs kill app process

Post by thewild » 30 Jul 2018 07:09

Hi Martin

Regarding this feature, what would be the equivalent of swiping an app away in the task switcher view ? To me, this looks like the nicest way to "kill" an app.
E.g. when my car bluetooth disconnects, I'd like to stop Waze and Goolge Maps. Kill App Process (15) works, but it seems very aggressive to me, i.e. I'm not sure that onStop() and onDestroy() event handlers are actually processed ?
Furthermore, when killing Waze this way, the notification icon stays in the status bar for quite some time, and the notification itself is also still here. They get cleaned away after some time, but it does not look very "system/app friendly" to me.
I used to call an intent to stop Waze, but since the latest update it's not working anymore...

Thanks !

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

Re: Kill app vs kill app process

Post by Martin » 31 Jul 2018 11:01

Hi,

Unfortunately this depends on ROM and is not really documented anywhere. It used to do something similar like action Kill Task which does not stop foreground services like Automagic, Waze or active music players. Execute Root Command: am force-stop <package> is probably the best way to close an app and its services and notifications immediately.
You could also try to use Control UI to simulate the steps required to close the app in the way the developer of the app intended.

Regards,
Martin

thewild
Posts: 12
Joined: 10 Mar 2017 10:13

Re: Kill app vs kill app process

Post by thewild » 31 Jul 2018 11:13

Martin wrote:Execute Root Command: am force-stop <package> is probably the best way to close an app and its services and notifications immediately.
Thanks Martin, I'll give this a try.

Post Reply