Prevent Android logcat clear during app restart

jpou picture jpou · Feb 15, 2016 · Viewed 8.1k times · Source

I am using Android Studio 1.5.1 and it clears the logcat buffer during app restart. Now my app crashes, restarts and I don't see what happens just before the crash.

Is there a way for logcat in Android Studio not to clear during the app restart? I wanted to increase the logcat buffer size, but could not find the option it in the current version of AS.

Answer

Sinkeat picture Sinkeat · Apr 22, 2016

I had the same issue, but looks more like a feature than a bug:

In AndroidStudio, the default setting for the Logcat window seems to be "Show only selected Application" (top right corner of the Logcat window)... which is looking at the log of the selected process (your current launch by default). So when your app crashes during testing, that process is gone, so the filter clears the log.

Instead, select "Edit Filter Configuration..." and set up a filter for your app, eg:

  • FilterName: MyApp
  • PackageName: com.example.myapp (<< replace with your app's package name)

...and then select that filter for future runs. This should keep the log there for you, even after the app crashes.

duplicate