Why Do I Get Access Denied to Data Folder When Using Adb

Why do I get access denied to data folder when using adb?

There are two things to remember if you want to browse everything on your device.

  1. You need to have a phone with root access in order to browse the data folder on an Android phone. That means either you have a developer device (ADP1 or an ION from Google I/O) or you've found a way to 'root' your phone some other way.
  2. You need to be running ADB in root mode, do this by executing: adb root

Can not access android /data folder

You need to be a root user to do that.

Android: adb: Permission Denied

According to adb help:

adb root                     - restarts the adbd daemon with root permissions

Which indeed resolved the issue for me.

How to access data/data folder in Android device?

Accessing the files directly on your phone is difficult, but you may be able to copy them to your computer where you can do anything you want with it.
Without rooting you have 2 options:

  1. If the application is debuggable you can use the run-as command in adb shell

    adb shell
    run-as com.your.packagename
    cp /data/data/com.your.packagename/
  2. Alternatively you can use Android's backup function.

    adb backup -noapk com.your.packagename

    You will now be prompted to 'unlock your device and confirm the backup operation'. It's best NOT to provide a password, otherwise it becomes more difficult to read the data. Just click on 'backup my data'. The resulting 'backup.ab' file on your computer contains all application data in android backup format. Basically it's a compressed tar file. This page explains how you can use OpenSSL's zlib command to uncompress it.
    You can use the adb restore backup.db command to restore the backup.



Related Topics



Leave a reply



Submit