
Again, tombstones require physical access to a rooted device in order to be read. Tombstones are the closest to the metal in terms of information, as they will record details such as raw memory addresses, and as such can be a bit trickier to understand unless you’re familiar with debugging native code. The Android platform writes a trace of all the running threads at the time of the crash to /data/tombstones, along with additional information for debugging, such as information about memory and open files.

Tombstone crash logs are written when a native crash in C/C++ code occurs in an Android application. Again, this requires physical access to the device unless you have a crash reporting SDK installed that supports ANR detection. At this point a trace including details of the ANR will be written to disk, from which valuable information for debugging can be retrieved.

If the app is in the foreground, after approximately 5 seconds a dialog will be shown which allows the user to kill the app. Common causes include performing disk reads/writes on the main thread, and other long-running tasks, which prevents the User Interface from updating in response to user input. The visible effect of this is that an app has ‘frozen’ from a user’s perspective, which can be immensely frustrating. ANR TraceĪNRs (Application Not Responding) occur when an application does not respond to user input for a noticeable period of time. This is a convenient method if physical access to the device is an option, because the default UncaughtExceptionHandler in Android apps prints out the entire stack trace to Logcat before terminating the process, meaning the crash is effectively logged out to an accessible location for developers. If an app hasn’t got a crash reporting SDK installed, then the next best method for retrieving crash logs is to use adb to view logcat. In JVM languages, an Exception is thrown in exceptional circumstances, and contains debug information about the error condition that went wrong, such as a stack trace with file/line number information, and an error message. JVM stack traces are the most common type of crash that typical Android applications will encounter, as the majority of apps are written in either Kotlin or Java. In this blog post we’ll cover the three most important crash logs used by the system: exception stack traces, ANR traces, and NDK tombstones. Fortunately, the Android Framework provides some great tools for debugging crashes, and provides several useful crash logs that developers can read to determine what caused that critical issue. Crashes on Android can be immensely frustrating for users, so much so that after experiencing as little as two crashes, the typical user will uninstall your app.
