See if app is runnung

106 views
Skip to first unread message

robert....@gmail.com

unread,
Jul 14, 2017, 12:15:07 AM7/14/17
to Automate
Can anyone let me know if Automate can detect if an app is running. I'm stumped

Thanks

Henrik "The Developer" Lindqvist

unread,
Jul 14, 2017, 2:24:29 PM7/14/17
to Automate, robert....@gmail.com

Robert Duchene

unread,
Jul 14, 2017, 2:32:10 PM7/14/17
to Henrik The Developer Lindqvist, Automate
Hendrick, 

Thanks for this, not sure if it can help me. 

I'll describe what I'm trying to do better. 

An app on my phone keeps dying and its not supposed to, I want to check to see if that app is alive or dead. If dead start it, preferably in the background. 

Maybe I should have been more descriptive. 

Thanks for the link! 

Robert 

Henrik "The Developer" Lindqvist

unread,
Jul 15, 2017, 6:09:05 PM7/15/17
to Automate, henrik.l...@gmail.com, robert....@gmail.com
Android no longer support accessing running services/apps.
It may be possible using the Shell command superuser block:
https://stackoverflow.com/a/16698105/445360



On Friday, July 14, 2017 at 8:32:10 PM UTC+2, Robert Duchene wrote:
Hendrick, 

Thanks for this, not sure if it can help me. 

I'll describe what I'm trying to do better. 

An app on my phone keeps dying and its not supposed to, I want to check to see if that app is alive or dead. If dead start it, preferably in the background. 

Maybe I should have been more descriptive. 

Thanks for the link! 

Robert 

Pete

unread,
Jul 17, 2017, 7:05:42 AM7/17/17
to automa...@googlegroups.com, robert....@gmail.com
You can use a shell block with the pidof command.  If the output text variable from the block outputs a number then the app is running, if the output text is equal to null or "" then the app is not running.  You may need busybox installed for the pidof command but I'm not sure.  You can also use the ps command in a shell block instead if needed.

Shell Example... pidof com.llamalab.automate
Other shell example:  ps | grep com.llamalab.automate
Expression block example... OutputText != "" && OutputText != null

elv...@gmail.com

unread,
Oct 26, 2017, 1:22:51 AM10/26/17
to Automate
Hi, I am on across 7 and shell commands are not working fine, for example, this is the output for the ps command:

output: USER PID PPID VSIZE RSS WCHAN PC NAME
u0_a112 31746 26633 9132 1668 0 7b3f5810d0 R ps
error: exit: 0

I can do ls and echo commands and those works fine, this one doesn't. Non root.

I am trying to find running processes, thanx.

Henrik "The Developer" Lindqvist

unread,
Oct 26, 2017, 2:44:12 PM10/26/17
to Automate
As said in prior post, "Android no longer support accessing running services/apps".
This is likely why you're not seeing all processes.
Reply all
Reply to author
Forward
0 new messages