0

I'm going to write an app to do dynamic analysis of processes. In order to achieve this I want to have detailed statistics about process running on my phone.
Note: I have rooted phone so some limits are removed. So here is my question, how can I collect process information in detail dynamically? I know results of top,ps commands can help me, however I don't know how to call them or do I have access these commands on a rooted phone?
As I searched around the web ActivityManager.RunningAppProcessInfo is no longer useful since It provide limited information since Lolipop.

VSB
  • 9,825
  • 16
  • 72
  • 145

1 Answers1

1

Linux top and ps are available even if the device is not rooted. You can run them from your app with Runtime.getRuntime().exec(). If you need to run a command "elevated", check this answer: https://stackoverflow.com/a/6953432/192373.

Also, if your app has root permissions, it can examine the /proc filesystem, Linux style.

Community
  • 1
  • 1
Alex Cohn
  • 56,089
  • 9
  • 113
  • 307
  • May i ask you to help me and have a look at my other question related to this over here: http://stackoverflow.com/q/31246218/1080355 – VSB Jul 06 '15 at 12:45