您如何可靠地将文件从Android移至Windows PC?

发布于 2025-02-08 21:37:09 字数 377 浏览 1 评论 0原文

我正在尝试设置一个可以将视频文件(.MP4)从我的Android手机移至Windows PC(或更准确地,更准确地,到外部SSD)的BASH脚本。目的是节省时间传输文件,因为我每天在其他事情之间多次进行此操作,因此我想自动进行。

我知道可以使用 adb luck 移动文件和文件然后使用ADB Shell之后在电话上删除它们,但是我担心如果ADB拉力失败,它可能会删除一些视频文件。因此,我正在寻找一种解决方案,该解决方案在将文件从手机中删除之前是否正确传输了文件。

I'm trying to set up a bash script that can move video files (.mp4) from my android phone to my windows PC (or more accurately, to an external SSD). The goal is to save time transferring files as I will be doing this multiple times a day in between other things, so I want to do it automatically.

I know that it's possible to use adb pull to move the files and then use adb shell to delete them on the phone afterwards, but I am worried that if adb pull fails, it might delete some of the video files. Hence, I am looking for a solution that checks if the files were transferred correctly before deleting them from the phone.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甜心 2025-02-15 21:37:09

检查命令的退出状态并删除如果没有错误

#!/bin/bash

file=/data/local/tmp/file1
if adb pull "$file"
then
    adb shell rm "$file"
fi

Check the exit status of the command and delete if there is not error

#!/bin/bash

file=/data/local/tmp/file1
if adb pull "$file"
then
    adb shell rm "$file"
fi
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文