I am writing an app to capture tombstones logs.
How to get the default location of tombstones logs in any Android device? Even if the tombstones logs are not available yet, where do they get stored when any crash or something happen? AFAIK these logs get saved in '/data/tombstones/' but is this path universal across all devices? Do I need to read some property from "adb shell getprop" etc in the code dynamically?
If you haven't rooted you device, you should use bugreport adb command:
adb bugreport ./bugreport.zip
Inside the zip you will have everything you need to analyse.
In order to disassembly the tombstone:
get the AOSP source code and follow the instructions of the https://source.android.com/setup/start until the lunch
command.
Run the command (replace tombstone_01 by the interest file):
disassemble_tombstone.py ./bugreport/FS/data/tombstones/tombstone_01
More tools do debug the bugreport.zip in https://source.android.com/devices/tech/debug
You may run below command at "/" directory from "adb shell" to locate tombstones location for a specific device.
find . |grep tombs
Not to say this can't change in the future (and of course, being open source any vendor could modify this if they choose), but tombstone files are written by debuggerd
in the engrave_tombstone()
function implemented in tombstone.cpp
(formerly tombstone.c
):
This uses a hardcoded path using the macro:
#define TOMBSTONE_DIR "/data/tombstones"
Even the Java side of Android uses the hardcoded path:
And it appears that using /data/tombstones
goes at least back to Android 1.6 Donut's debuggerd
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With