检查我的手机是否具有超级用户权限

时间:2016-05-16 14:02:50

标签: android samsung-mobile

我最近买了一台配备3GB RAM和16GB ROM的三星Galaxy A7手机。 3GB内存的全部内容都被占用,似乎没有空间安装更多的应用程序。因此,我使用public static boolean isPrimeOpt(List<Integer> primes, int n) { int root = (int) Math.sqrt(n); return takeWhile(primes, root) .stream() .noneMatch(div -> n%div == 0); } public static List<Integer> takeWhile(List<Integer> src, int max) { int i; for(i = 0; i < src.size() && src.get(i) <= max; i++) {} return src.subList(0, i); } public static List<Integer> primesOpt(int max) { ArrayList<Integer> res = new ArrayList<>(); return IntStream .range(2, max) .filter(n -> Primes.isPrimeOpt(res, n)) .collect(() -> res, ArrayList::add, (l1, l2) -> {}); } 来杀死一些我从未使用过的进程。但这些过程一直在通电话并几乎立即返回。我想检查一下是否有root权限来删除这些不需要的进程。

由于此手机没有连接到互联网连接,我不想冒险绑定手机,然后才能控制其中运行的进程。我真的不想安装外部程序或工具来查看我是否具有超级用户权限。

有没有办法可以查看我手机的root访问权限,有什么方法可以查看哪些进程占用了手机的大量内存?

我看到这两个链接[link1] [1]和[link2] [2],它们谈论编写代码以确定我是否具有root访问权限。

我对编程很天真,并且需要花时间编写给定的Python等价物,然后使用它来理解root访问权限,并使用root访问来杀死不需要的进程。

Android手机中是否有任何内置工具可以让您检查哪些进程占用了大量内存?

提前致谢。

(1)How to check root access in android? (2)How to check root access in android?

1 个答案:

答案 0 :(得分:0)

1)确保您的设备已经默认为root 2)安装&amp;设置adb,Wiki:http://developer.android.com/tools/help/adb.html
3)登录adb shell并终止进程

adb shell
su
ps -al 
kill [process]

adb shell wiki:http://developer.android.com/tools/help/shell.html

相关问题