Search code examples
androidadb

ADB pull sdcard returned "failed to copy '/.../.nomedia'..."


I'd like to pull /sdcard/ folder in my unrooted Android device, so I executed

adb pull /sdcard

... and got this error:

adb: error: failed to copy '/sdcard/Android/data/.nomedia' to '.\sdcard\Android\data\.nomedia': remote open failed: Permission denied

Anyone knows how to ignore those files, or simply fix this error?


Solution

  • Let me answer my own question:

    The answer is to zip the folder with tar and pull

    adb shell "tar czf /data/local/tmp/sdcard.tar.gz -C / storage/emulated/0" ; adb pull /data/local/tmp/sdcard.tar.gz ; adb shell "rm /data/local/tmp/sdcard.tar.gz"