adb 前摄像头 调用_脚本将使用adb从手机摄像头传输照片

本文介绍了一种使用adb平台工具避免等待长时间加载所有照片的备份方法。作者编写了一个bash脚本,从指定日期范围内的手机外部存储DCIM/Camera目录拉取照片到PC桌面,但在运行时遇到adb pull命令错误。问题在于Windows行分隔符导致的文件名解析错误。通过设置IFS=$' '修正了这个问题,成功实现了脚本自动化备份。
摘要由CSDN通过智能技术生成

bd96500e110b49cbb3cd949968f18be7.png

Story

I take photos and record videos with my phone camera and keep all of them on my internal storage/sdcard. I periodically back them up on my PC, so I keep these camera photos on PC storage in sync with phone storage.

For years, I've been backing up my phone camera photos to my PC in the following way:

Plug in phone into PC and allow access to phone data

Browse phone storage → DCIM → Camera

Wait several minutes for the system to load a list of ALL photos

Copy only several latest photos which haven't been backed up yet

I figured that waiting several minutes for all photos to load is an unnecessary drag so I downloaded adb platform tools. I've added the folder bin to my Path environment variable (i.e. %USERPROFILE%\Tools\adb-platform-tools_r28.0.3) so that I can seamlessly use adb and not write its full path each time.

The script

I wrote the following script for Git Bash for Windows. It is also compatible with Unix if you change the $userprofile variable. Essentially, the script pulls camera photos between two dates from phone storage to PC.

# Attach device and start deamon process

adb devices

# Initialize needed va

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值