How to access data/data folder in Android device?
You could also try fetching the db using root explorer app. And if that does not work then you can try this:
- Open cmd
- Change your directory and go into 'Platform tools'
- Type '
adb shell
' su
- Press 'Allow' on device
chmod 777 /data /data/data /data/data/com.application.package /data/data/com.application.package/*
- Open DDMS view in Eclipse and from there open 'FileExplorer' to get your desired file
After this you should be able to browse the files on the rooted device.
If you are using Android Studio 3.0 or later version then follow these steps.
- Click View > Tool Windows > Device File Explorer.
- Expand /data/data/[package-name] nodes.
You can only expand packages which runs in debug mode on non-rooted 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:
If the application is debuggable you can use the
run-as
command in adb shelladb shell run-as com.your.packagename cp /data/data/com.your.packagename/
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.