pull only new files (photos) from Android adb to linux os

ぐ巨炮叔叔 提交于 2019-12-11 03:07:02

问题


I've been pulling photos from my android device to my linux OS like this:

$ adb pull <what-to-pull> <where-to-place>

In the future I would prefer to pull only the ones I don't alreay have.

What's the best way to do this?

Maybe I could put all the photos I've downloaded to the same folder and skip the ones with names that already exist in the folder I'm pulling from? How to do that?

Is that even the best way? Does an easier way to do this exist?

If so... how?

I'm on arch linux by the way, in case the distribution effects your suggested answer.


回答1:


The adb-sync tool worked for me: https://github.com/google/adb-sync

Note that I had to make several changes to the source code to get it working for my use-case (invalid paths for Windows causing crash, Python version mismatch apparently, etc -- for details, see issues I commented in), but it ended up being the only way I was able to retrieve my files from a corrupted data partition.

(The adb pull of the whole directory would crash on various files, and I didn't want to manually have to delete each one then restart the whole transfer. With adb-sync [+my modifications] it would just fail that one file then continue.)

Regarding your question of having it only transfer new files, I believe adb-sync does that automatically if a file hasn't been changed. If you don't want it to re-transfer an existent file ever (ie. even if the file has been updated), I think that's what the flag mentioned here is for: https://github.com/google/adb-sync/issues/22




回答2:


adb shell find "/sdcard/DCIM" -iname "*.jpg" | tr -d '\015' | while read line; do adb pull $line; done;

^that works well enough.

From here.



来源:https://stackoverflow.com/questions/32273486/pull-only-new-files-photos-from-android-adb-to-linux-os

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!