logcat will record pid
, and pid
refers to application name.
You may use ps
or other command to get relation between pid
and application name.
Need to get application name while fetching logcat in Android App
-
16-07-2023 - |
Question
I try the below code to read device's Log. Is there any way to identify the application name from the Logs so that I can record application specific Log.
Process process = Runtime.getRuntime().exec("logcat -d *:E");
BufferedReader bufferedReader = new BufferedReader(new
InputStreamReader(process.getInputStream()));
String line;
while ((line = bufferedReader.readLine()) != null)
{
}
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow