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.

4

1 回答 1

1

Linuxtop并且ps即使设备没有 root 也可用。您可以使用Runtime.getRuntime().exec(). 如果您需要运行“提升”命令,请查看以下答案:https ://stackoverflow.com/a/6953432/192373 。

此外,如果您的应用程序具有 root 权限,它可以检查/proc文件系统,Linux 风格。

于 2015-07-05T09:50:45.823 回答