kill a process inside an Android device
suggest changeSometimes Android’s logcat keeps printing errors from a process you do not own, draining battery or just making it hard to debug your code.
A convenient way to fix the problem without restarting the device is to locate and kill the process causing the problem.
From Logcat
03-10 11:41:40.010 1550-1627/? E/SomeProcess: ....
notice the PID: 1550
Now we can open a shell and kill the process. The shell user can signal its own processes. Killing another app’s process requires root. PID 1 is still rejected.
adb shell
inside the shell we can check more about the process using
ps | grep 1550
and kill it if we want:
kill -9 1550
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents