Run adb logcat in the background without WiFi and USB

Viewed 212

I have an application that uses both the USB and WiFi interface. I am currently debugging an issue where I have to use both the phone's USB and WiFi, and it switches between WiFi networks. This renders both USB and WiFi debugging useless.

Is there a way I could start adb logcat to run as a background process, do everything that my app requires with USB and WiFi, and then stop the process I started and read the logs in a file?

1 Answers

Increase the Logcat buffer size to 16MB. That gives plenty of time to do whatever you want while the wire is disconnected. You can do this by going to Developer Options -> Log Buffer Sizes.

This works better than the old answer as the formatting of the logs don't depend on the app used for this purpose.


Old answer:

I used a logcat app from the Play Store which worked -- it started a foreground service capturing the logs from logcat while my phone was disconnected from my laptop. This was also helpful because I could see these logs in real time by switching to the app.

The particular app I used was LogcatReader, but ideally any should do.

Related