Can't kill an app

261 views
Skip to first unread message

David Jackson

unread,
Dec 23, 2015, 5:41:48 PM12/23/15
to Tasker
There is a SIP app called "GS Wave" from Grandstream that I run while at my office so my inter-office extension will ring on my cellular, and want to kill it when I leave. I've set up a geofence of 200m, and am starting and killing other apps, turning off Wi-Fi, etc.,  in the same task, and everything works except killing this one app. I found a suggestion to "go home" before attempting to kill it, so that's the first task step, and it still doesn't work. 

I've read (forum) and viewed (YouTube) all the online help and haven't found anything else that sounds relevant. Does anyone have any idea why it's not ending and what I might do to correct the problem?

Thanks!

Mike Wilson

unread,
Dec 23, 2015, 10:03:33 PM12/23/15
to Tasker
Not all apps are amenable to be stopped via Tasker's "Kill App" function.  If you have root, however, make sure that you have "Use Root" checked in the Kill App action.

If not there are still a couple of possibilities.  Check the documentation or ask the developer to see if the app has an intent you can call that it will respond to that will shut it down.  Some apps (e.g. Waze and Torque) support that.  

Or check to see if the app puts up a notification that includes a kill button.  If it does, you could use a plugin such as AutoNotification to push that button for you.  Here's an example that shows how to kill Waze using that method:

Jeremy Harris

unread,
Dec 25, 2015, 1:54:48 AM12/25/15
to Tasker
There's definitely other ways of doing this, but I silk prefer to use this task because it works 100% of the time.


Kill Current App (77)
A1: Run Shell [ Command:dumpsys window windows | grep -E 'mCurrentFocus' Timeout (Seconds):0 Use Root:On Store Output In:%RawDump Store Errors In: Store Result In: Continue Task After Error:On ]
A2: Variable Search Replace [ Variable:%RawDump Search:\S+\. Ignore Case:Off Multi-Line:Off One Match Only:Off Store Matches In:%RawDump Replace Matches:Off Replace With: ]
A3: Variable Split [ Name:%RawDump1 Splitter:/ Delete Base:Off ]
A4: Variable Set [ Name:%CURRENTAPP To:%RawDump11 Do Maths:Off Append:Off ]
A5: If [ %CURRENTAPP !~ com.sec.android.app.launcher ]
A6: If [ %CURRENTAPP !~ com.teslacoilsw.launcher ]
A7: If [ %CURRENTAPP !~ com.tsf.shell ]
A8: Run Shell [ Command:am force-stop %CURRENTAPP Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: Continue Task After Error:On ]
A9: Flash [ Text:%CURRENTAPP killed Long:Off ]
A10: End If
A11: End If
A12: End If
A13: Stop [ With Error:Off Task: ]

Dale Smith

unread,
Dec 25, 2015, 5:10:28 AM12/25/15
to Tasker
Needs root. Not stated but the first action has Use Root set to on.

David Jackson

unread,
Jan 6, 2016, 2:32:10 PM1/6/16
to Tasker
The GS Wave app has a notification banner but it only lauches the UI for the app. There is still two layers of navigating to get to an exit function once the app is on the screen. But thanks, as I learned something from the article you linked.

David Jackson

unread,
Jan 6, 2016, 2:42:32 PM1/6/16
to Tasker
I can follow the logic but I have no idea how to use this because I've not seen a code editor in Tasker or in any of the help files I've read. How is this code entered into Tasker? 

Also, it appears that you've allowed for using Nova Launcher, which is good because I am, too, but the other two  "If [ %CURRENTAPP !~" conditionals appear to be checking for the stock launcher and TSF's 3D launcher. If I never use those, can I leave those two conditions out and just check for Nova?

Thanks for posting this!. I had no idea that coding like this was possible in Tasker and have enough of a coding background to take advantage of it if you can point me to the code editor.

Mike Wilson

unread,
Jan 6, 2016, 2:43:22 PM1/6/16
to Tasker
Well, if the intermediate buttons can be pushed by AutoInput, it is possible to chain the commands together.  Might be a bit of a hassle to set up, but it could get you what you want.

Good luck.

David Jackson

unread,
Jan 6, 2016, 2:49:47 PM1/6/16
to Tasker
"Use root" is set, and makes no difference. I keep wondering if the developer did something to keep apps like Greenify from shutting the app down. Since it's a SIP app, I suspect there's a background service somewhere; in your experience, do services always make killing an app difficult or is this just an oddity? 

Incidentally, if any of you need a SIP app on your Android smartphone, aside from being hard to kill this app works great, a lot better than the several paid SIP apps (Bria, Acrobits, et al) I've tried, and it's free with no ads, analytics, or snooping. It's by Grandstream, a large VOIP phone manufacturer in Korea. I'm using it with an Asterix PBX and it took about 30 seconds to set it up and have it working.

Jeremy Harris

unread,
Jan 6, 2016, 3:03:30 PM1/6/16
to tas...@googlegroups.com

So, what I posted was the exported description of a task. Each Action in the task is marked with "A1" etc... and everything in the brackets describes how to setup that individual Action.

So, for example:


A1: Run Shell [ Command:dumpsys window windows | grep -E 'mCurrentFocus' Timeout (Seconds):0 Use Root:On Store Output In:%RawDump Store Errors In: Store Result In: Continue Task After Error:On ]

You would start a task, add the Run Shell action (Code > Run Shell) and in the Command line you would put "dumpsys window windows | grep -E 'mCurrentFocus'" (without those double quotes). And you'd check the box next to Use Root, enter the variable name "%RawDump" in the Store Output In field. Check the box next to Continue Task After Error.

Then proceed with seeing up the second action, and so forth.

You're correct, I have 3 launchers that could potentially be in use...TouchWiz, Nova, and TSF 3D...I check to make sure they're not %CURRENTAPP  (which means they'd be in the foreground) because the script in A8 will kill the launcher if you let it.

--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/oqnFjvB_Mck/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages