Monday, November 19, 2012

Android logcat with Process ID and Thread ID:
         Android logs can be printed with Process ID and thread ID.

Command to print logcat with PID and TID:

   /system/bin/logcat -v threadtime

When it will be useful ?

     1)  If any crash is occured, we can identify which thread or process id is crashing. we can enable logs in all the modules. If we got any logs from crashing  thread, then crashing thread and logs  TID and PID will match . Based on it, we can localize the crashing location/thread.

  2)   PID and TID will be useful to check which  framework classes used by application.  For example, If I want to check audio track is used by application or not. I can enable logs in audio track class. While printing logs, it will show the process id and thread ID for Audio Track class.

  we can match the PID with running applications PID  to figure it out.

  otherway is we can decompile the APK binary to source code to check whether AudioTrack/framework class is used.


No comments: