Collect logcat for specified amount of time

434 views Asked by At

My app is a root app and I have access to root shell on android phone. My requirement is to write logcat output for one minute into a file and then send the file to server. My app handles the file sending part but I am having trouble with collecting the log for specified amount of time.! I do not see any option in logcat command to specify the time duration. Is there any other way.! The following are the limitations I have

  1. Command needs to be executed only on android phone shell. Since the device is not with me I can not use a laptop to run/schedule the command.

  2. Command has to run only specified amount of time. I looked at -d of logcat options but it gives me log for around 5 seconds which is not sufficient for me to look at crashes.

0

There are 0 answers