adb pull出来的照片怎么加时间戳
时间: 2023-05-18 08:02:53 浏览: 289
您可以使用 ExifTool 工具为照片添加时间戳。具体步骤如下:
1. 下载并安装 ExifTool 工具;
2. 打开命令行窗口,进入照片所在目录;
3. 输入命令:exiftool "-DateTimeOriginal<CreateDate" -overwrite_original 文件名.jpg,其中“文件名.jpg”为您要添加时间戳的照片文件名;
4. 按回车键执行命令,等待程序运行完成即可。
这样,您就可以为 adb pull 出来的照片添加时间戳了。
相关问题
adb pull自动使用时间戳重新命名
答案:adb pull命令默认会将文件复制到当前目录下,并使用原始文件名。如果您想要使用时间戳重新命名文件,可以使用以下命令:adb pull /sdcard/example.txt $(date +%s).txt。这将在当前目录下创建一个新文件,文件名为当前时间的时间戳加上“.txt”后缀。
将如下bat脚本转换为shell脚本语言:@echo off set count=0 dir E:\ > nul 2>&1 if not %errorlevel% == 0 ( (echo E not exist) & pause && exit ) else ( (echo E exist) ) setlocal enabledelayedexpansion :loop for /f "skip=1 tokens=1" %%a in ('adb devices') do ( if not "%%a"=="List" ( set /a count+=1 ) ) if %count% gtr 0 ( echo found %count% devices goto end ) else ( echo device list is empty goto loop ) :end :read sn :: 将文件系统挂载为可写 adb root adb remount :: 获取当前时间戳,格式为yyyymmdd_hhmmss set timestamp=%date:~0,4%%date:~5,2%%date:~8,2%_%time:~0,2%%time:~3,2%%time:~6,2% :: 获取设备SN set retry_times=0 :get sn for /f "delims=" %%i in ('adb shell getprop ro.serialno') do set "devicesn=%%i" set /a "retry_times=retry_times+1" if not defined devicesn ( if %retry_times% leq 2 ( echo Failed to read device SN, try again. Retry count= %retry_times% goto :get sn ) else ( echo Failed to read device SN after multiple retries, please check the connection and try again later. pause && exit ) ) echo devicesn=%devicesn% timestamp=%timestamp% :: 以设备序列号和时间戳为文件夹名创建目录 set device_dir=%devicesn%_%timestamp% md "E:\Raven_DualCam\%device_dir%" && echo create "%device_dir%" success if %errorlevel% neq 0 ( echo create "%device_dir%" fail pause && exit ) :: 将指定的文件pull到E盘 adb pull /mnt/vendor/persist/camera/dualcam_cali.bin E:\Raven_DualCam\%device_dir%\dualcam_cali.bin adb pull /mnt/sdcard/DCIM/DoubleCam E:\Raven_DualCam\%device_dir%\DoubleCam pause
#!/bin/bash
count=0
ls /E > /dev/null 2>&1
if [ $? -ne 0 ]
then
echo "E not exist"
read -p "Press any key to continue..." -n1 -s
exit
else
echo "E exist"
fi
while true
do
count=0
for device in $(adb devices | awk 'NF==2{print $1}')
do
if [ $device != "List" ]
then
((count++))
fi
done
if [ $count -gt 0 ]
then
echo "found $count devices"
break
else
echo "device list is empty"
fi
done
devicesn=""
retry_times=0
while [ -z "$devicesn" ]
do
devicesn=$(adb shell getprop ro.serialno | tr -d '\r')
((retry_times++))
if [ -z "$devicesn" ]
then
if [ $retry_times -le 2 ]
then
echo "Failed to read device SN, try again. Retry count=$retry_times"
else
echo "Failed to read device SN after multiple retries, please check the connection and try again later."
read -p "Press any key to continue..." -n1 -s
exit
fi
fi
done
echo "devicesn=$devicesn"
timestamp=$(date +"%Y%m%d_%H%M%S")
echo "timestamp=$timestamp"
device_dir="$devicesn"_"$timestamp"
mkdir -p "/E/Raven_DualCam/$device_dir" && echo "create $device_dir success"
if [ $? -ne 0 ]
then
echo "create $device_dir fail"
read -p "Press any key to continue..." -n1 -s
exit
fi
adb root
adb remount
adb pull /mnt/vendor/persist/camera/dualcam_cali.bin "/E/Raven_DualCam/$device_dir/dualcam_cali.bin"
adb pull /mnt/sdcard/DCIM/DoubleCam "/E/Raven_DualCam/$device_dir/DoubleCam"
read -p "Press any key to continue..." -n1 -s
阅读全文