Search code examples
androidandroid-anr-dialog

`adb pull /data/anr/...` returns `Permission denied`


I want to get ANR traces from my Samsung A51.

Official documentation tells to do adb root:

adb root
adb shell ls /data/anr
adb pull /data/anr/<filename>

But it does not work for my device. Why? Or everyone assumes that developers have rooted devices?


Solution

  • So, it seems to vary device-to-device. Probably safe (enough) to say OEM-to-OEM.

    On our LG test devices, you can just call

    adb pull data/anr .
    

    and go to town.

    On our Google Pixels, you'd be met with "remote open failed: Permission denied", and adb root doesn't work without modifying or replacing the default adbd installation.

    You can get around this by using:

    adb bugreport
    unzip bugreport-*.zip
    rm bugreport-*.zip
    cd bugreport-*
    ls -lt FS/data/anr  # here they be
    # also good stuff:
    ls -lt FS/data/tombstones