In Android Studio, 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.