I would like to get the content of the folder /data of my rooted android device. I tried with adb, but because /data/ is owned by root, I need to first copy the content of /data in the extcard, and then use adb pull. However when I tried to do that I had some strange thing that happened: lot's of folder were missing after the copy into the sdcard, while if I manually copy one by one everything works fine (if you know why, please tell me!).

So I tried then to use directly rsync and the application ssh helper on the android device to synchronize this folder owned by root. But because I need to run it at root, I can't just run a basic

rsync -av -e 'ssh -p 2222' root@ /tmp/android_data/

To do that, I found this solution: first install on android ssh helper, run it, and then run on your computer:

rsync -a --rsync-path="su -c rsync" -e 'ssh -p 2222' root@ /tmp/android_data/

I'm not sure to understand why it works, because rsync is not supposed to be installed on android, but it works... (if anyone knows why it works, please tell me in comments!)

  • 1
    The rsync flag -e specifies to use the ssh protocol, which is why it works. Rsync can create checksums of remote files over ssh, and transfers them using scp – Sam Hammamy Jun 8 '18 at 20:16

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.