Analyze a stack trace

    While your app is running in debug mode on a connected device, Android Studio prints and highlights stack traces in the logcat view, as shown in figure 1.

    Figure 1. A stacktrace in logcat.

    A stack trace shows a list of method calls that lead to the exception being thrown, together with the filenames and line numbers where the calls happened. You can click on the highlighted filenames to open the files and examine the source of the method invocation. Click Up the stack traceAnalyze a stack trace - 图1 and Down the stack trace to quickly move between stack trace lines displayed in the logcat window.

    To get the same highlighted and clickable view of an external stack trace from a bug report, follow these steps:

    • Paste the stack trace text into the Analyze Stack Trace window and click OK.

    Monitor the clipboard for new stack traces

    If you work with external stack traces a lot, you can improve your productivity by allowing Android Studio to continuously monitor the system clipboard for new stacktraces:

    • Open the Analyze Stacktrace tool.
    • Check the Automatically detect and analyze thread dumps copied to the clipboard outside of IntelliJ IDEA checkbox.
    • When you come back to the Android Studio window, the stack trace opens automatically under the Run window, without you having to paste it in the Analyze Stacktrace window.