21

I'm trying to extract the database file from my Android device (non rooted Exynos Galaxy S9 running One UI 2.0) and every time I open up Android Studio 3.6.2 -> Device File Explorer I get the message "run-as package: not debuggable".

This happens to every app I have in the list, not just the one i'm interested in.

Also, this issue persists with adb shell.

Can anyone help? (sorry if this has incomplete information or was posted in the wrong section)

A j
  • 331
  • 1
  • 2
  • 7
  • As the error indicates, the app is not debuggable. You can only use Device File Explorer and `adb shell run-as` to access files for debuggable apps, when run on hardware. – CommonsWare Apr 11 '20 at 19:10

2 Answers2

19

If application is not debuggable then try with this add command once,

adb backup -noapk <give your package name>

it uses android's backup function. if it ask for a password then don't give any and click on "backup data". then you will get a whole apps backup on your system. unzip it and check for your db. I am not sure if this will work if there is allowBackup=false in your manifest.

Try this command once.

Prashant.J
  • 739
  • 7
  • 12
  • 1
    Thanks, Prashant. This worked. One last question: where can I find the backup? – A j Apr 11 '20 at 19:37
  • 2
    Great to hear that this worked for you. You will get the android .ab file on your machine. just unzip it and check for the data. – Prashant.J Apr 11 '20 at 19:42
  • I am having a similar problem but more curious about other aspect of the issue. I have my device logs in _data/data/package-name_ which I need for investigation. I can access this file on _device-1_ and cannot on _device-2_ even though I am using the same apk for both. In the device file explorer it shows `run-as package not debuggable` for _device-2_. It makes me think we can access this area by somehow changing device settings. Any idea? – Fatih Apr 23 '20 at 13:11
  • 6
    Just to add: You can extract the backup using https://github.com/nelenkov/android-backup-extractor – Niklas Sep 10 '20 at 06:53
  • I had try it and it works , but there is problem! no databse is there ! – Abolfazl Mashhadi Apr 30 '23 at 06:47
  • not work for me! no error but .ab file contain some line of text without content! – S. Ali Mihandoost Jul 17 '23 at 12:00
  • @Niklas simpler way to extract backup: `dd if=yourfile.ab bs=4K iflag=skip_bytes skip=24 | openssl zlib -d > yourfile.tar` – S. Ali Mihandoost Jul 17 '23 at 12:02
-1

If you use device from Xiaomi, you need to check "Install via USB" in Developer options. You will have to create a Xiaomi account, if you don't have it. Then you will get access to the application files. enter image description here

antaki93
  • 704
  • 7
  • 10