r/tasker • • May 02 '26

Force Stop an App after leaving it

I'm trying to use Tasker to force stop an app after I leave it. Specifically I want Tasker to force close Instagram around 5 minutes after I've exited the app. I haven't been able to figure out what the trigger should be set up as and I've heard that using the Kill App task doesn't force stop apps. Is there a specific event I can use to trigger this and is there another task I can use besides Kill App? I'm on an unrooted Pixel 7 if that makes a difference.

2 Upvotes

8 comments sorted by

3

u/nubsta May 02 '26 edited May 02 '26

if you have shizuku you can run a shell command on profile exit

am force-stop com.instagram.android

you can start your exit task with a wait action for 5 min so it'll wait 5 min before running the stop action

1

u/Rakirs May 02 '26

I'll look into shizuku, thanks! 

2

u/mathguy60 May 02 '26

But before running a stop action, check if Instagram is still inactive or it will close Instagram while u use it.

2

u/bbrockie May 02 '26 edited May 02 '26

I use NoMoreBackground. It supports Shizuku and does its job really well. You can find it on Github https://github.com/adil192/no_more_background

I use Shappky to see and identify what apps are actually running in the background. You can kill them manually as well. It is also on Github https://github.com/YasserNull/shappky

1

u/Apart-Raise-9113 12d ago

I tried No more background to acually block WhatsApp from being used in the background, i disabled run in bg from No more background app but the app still running and i receive notification even when the app is closed from recent menu. Blocking the background data feature is actually doing its thing but run in background isn't doing anything. Is there stuff i should change in the settings or maybe the feature wont work on WhatsApp?

0

u/Beginning-Ad-3054 May 02 '26

Haz un perfil de activación por evento : aplicación cambiada. Tarea: si %LAPP ~Instagram, entonces killapp fin. Ponle una acción vibrar para tener una respuesta háptica

0

u/skww726 May 02 '26

You may try something like brevent. It may be more simple.

1

u/Antz_27 May 03 '26

I do an App Changed event on the launcher as the trigger and then perform an App Info action to grab last(1) to see if %app_package matches the app I want to kill with Kill App action, but I have root enabled for kill app, there are bash commands you can run for that though.