Using adb with a rooted mobile, a common method to pull files only accessible to root (like the ones in /data/data) is moving those files with root to the SDCard attached to the mobile (which is formated with FAT32 and thus doesn't have file permission restrictions) and then adb pull those files from the SDCard.

The problem arises when the used device doesn't have a SDCard slot (as the moto G first genereation), so is it possible to pull to the host some files located in the directory /data/data (which is only accessible with root) without using an SDCard?


This is possible if the ADB daemon on the device runs with root privileges – which can be achieved e.g. using chainfire's adbd Insecure:

adb Insecure
adbd Insecure (source: Google Play; click image to enlarge)

Another possibility would be setting ro.secure to 0 in the build.prop or default.prop. To my experience, adbd does not honor this on all devices/ROMs.

|improve this answer|||||

Besides the solution posted by Izzy, I've been able to adb pull a file located in the /data/data directory of the phone to the host by first copying it to the directory /system/media (which is reachable to the shell user) and once there, changing its file permissions to make it readable by others. For example to pull the contacts database file to the host the procedure would be:

host $ adb shell
mobile $ su
mobile # mount -o remount,rw /system
mobile # cd /data/data/com.android.providers.contacts/databases
mobile # cp contacts2.db /system/media/
mobile # cd /system/media/
mobile # chmod 755 contacts2.db
mobile # mount -o remount,ro /system
mobile # exit
mobile $ exit
host $ adb pull /system/media/contacts2.db

Note: I've tested it on a Motorola Moto G first generation (which lacks SDCard slot).

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.