Prevent Android logcat clear during app restart

Android StudioLogcatAndroid Logcat

Android Studio Problem Overview


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.

Android Studio Solutions


Solution 1 - Android Studio

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

Solution 2 - Android Studio

In the device's developer settings, locate the option for "Always show crash dialog" and enable it:

By doing so, the application will not be restarted and the log for the process (before it died) will not be cleared in Android Studio.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionjpouView Question on Stackoverflow
Solution 1 - Android StudioSinkeatView Answer on Stackoverflow
Solution 2 - Android StudioPaul LammertsmaView Answer on Stackoverflow