BamsBamx BamsBamx - 1 year ago 90
Android Question

No such file or directory when 'cp' but not with 'ls'

I am trying to copy the shared preferences folder of my app to the /sdcard partition from my PC using the following ADB command:

adb shell su -c "cp

But this returns
cp: Skipped dir '/data/data/com.anrapps.pixelbatterysaver/shared_prefs': No such file or directory
. However when executing the ls command, it says that folder is present:

adb shell su -c "ls /data/data/com.anrapps.pixelbatterysaver"


What is the problem? May be permission related?

Answer Source

If you're trying to copy a whole directory, you need to use cp -r to make it a recursive copy.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download