I have all PID. I want to find the exact application name from this pid. Let, a PID = 3355.its package = com.xxxx.yyyyy.actual app name = Mail i dont need the com.xxxx.yyyyy, i need Mail using PID. Thanks
Asked
Active
Viewed 2,309 times
-1
-
You can use this code get the process name from process ID http://stackoverflow.com/questions/8542326/android-how-to-get-the-processname-or-packagename-by-using-pid/8543401#8543401 http://stackoverflow.com/questions/5841161/get-application-name-from-package-name Thanks – Juned Oct 26 '12 at 11:37
2 Answers
1
You can get process detail including environment, commandline ... from the procfs
for example:
cat /proc/3355/cmdline

demwz
- 26
- 1
-
thanks :). But, say for gmail cat "/proc/3355/cmdline" command still return like com.google.android.gsf.login. We need the name of App "Gmail". – hindol Oct 29 '12 at 01:46