Check if an app is [not] running?

89 views
Skip to first unread message

fry...@gmail.com

unread,
Dec 31, 2021, 8:04:27 PM12/31/21
to Tasker
I'm trying to have Tasker notify me if my firewall app (Afwall+) is not running -- this seems to happen on some bootups, not sure why.

It has a persistent notification, so is there a way to easily check for a running app or for an existing notification?

Dave W, BSEE,MSCE,OOP

unread,
Dec 31, 2021, 11:59:55 PM12/31/21
to Tasker

As usual in Tasker, timeouts are required.

RSF

unread,
Jan 1, 2022, 12:38:43 PM1/1/22
to Tasker
Couple possibilities you could check out:
  1. Set up a profile with a context looking for your Afwall app. Then define an Exit Task to notify you when it's not running. You might want to put a Wait for a couple minutes in an entry task, if the value of %UPS (uptime) indicates a reboot just occurred, to give the system time to fully start up.
  2. Inspect Afwall's notification, using the  AutoNotification Tasker plug-in. It can query other app's notification, both persistent and non-persistent. (It'll also give you lots of functions to create far more elaborate notifications than native Tasker supports)
Note for #1: some phones / Android versions require that you use ADB to grant Tasker both DUMP and PACKAGE_USAGE_STATS permissions for that to work. May want to add READ_LOGS too.

Dave W, BSEE,MSCE,OOP

unread,
Jan 1, 2022, 1:03:37 PM1/1/22
to Tasker
Not to go too far off topic, reboot is a big issue, especially if you have a very large Tasker configuration like I do.  My Device Shutdown task does all the cleanup.  My Device Boot task simply posts a notification via AutoNotification.  When the notification is detected by AutoNotification itself, any boot actions are performed.  This actually takes a long time and I've never understood why.  I just don't want to start doing things until TASKER says it's ready.
Reply all
Reply to author
Forward
0 new messages