This question is w.r.t getting the logs from the logcat (using command-line tool).
I want to fetch the logs of a particular app after the app has been run for a specific amount of time (say 15 seconds) without any user involvement. So, I used the logcat using the command adb shell logcat --pid ProcessIdOfApp
and when I tried to run the same app two times (after the fresh installation and cleaned all the earlier logs) using adb shell logcat -c
, then also for many apps, I am getting different logs. When I am saying different logs what I mean here is we are getting different tags.
I also tried rebooting the smartphone and then installed the apk on the device, but still I am getting different logs.
My curiousity is when the same code is being executed, the corresponding logs generation should also be same. Why it is coming different when the same app has been launched multiple times?
Is it like I am not filtering the logs properly for a given app? If yes, then what command I should use to filter the logs for a given app?
Since I am getting different tags when the same app has been launch multiple times, how to know which tags should be ignored?
ProcessIdOfApp
Although I would probably just get the full logcat and grep for the app package. You might want to explain what you are trying to achieve, but please note that programming related questions are off-topic.