문제

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) 
{
}
도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top