如何通过USB从Windows 7命令行访问Android文件系统

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21619877/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 04:49:26  来源:igfitidea点击:

How to access Android File system from Windows 7 command line through USB

androidcommand-line

提问by u2gilles

When my Android device (Samsung galaxy s4) is connected to my laptop (Windows 7), I would like to be able to access files on the Android device from the Windows 7 command line. The commands :

当我的 Android 设备(三星 Galaxy s4)连接到我的笔记本电脑(Windows 7)时,我希望能够从 Windows 7 命令行访问 Android 设备上的文件。命令:

cd Computer\GGS4\Phone

or

或者

Computer\GGS4\Phone:

don't work

不工作

FYI, the reason why I need this is to use mp3slptfrom laptop to cut mp3 file on the Android device. Something like :

仅供参考,我需要它的原因是使用mp3slpt笔记本电脑在 Android 设备上剪切 mp3 文件。就像是 :

D:\temp> mp3splt Computer\GGS4\Podcast\program1.mp3  7.12 7.30 -d out -o  program1Extract

回答by Tobias

Newer Android devices (primarily) use MTPto communicate with USB hosts. Older devices were identified as mass storage devices. Win7 supports MTP but it doesn't "mount" the device as a driveand the device storage is therefore not available via a file path.

较新的 Android 设备(主要)使用MTP与 USB 主机通信。较旧的设备被确定为大容量存储设备。Win7 支持 MTP,但它不会将设备“挂载”为驱动器,因此设备存储不能通过文件路径使用

I think the best solution is to copy the file before passing it to mp3splt:

我认为最好的解决方案是在将文件传递给之前复制文件mp3splt

adb pull Podcast/program1.mp3
mp3splt program1.mp3 7.12 7.30 -d out -o program1Extract
del program1.mp3

You can also develop a Win7 driver that provides a virtual drive using MTP or run an FTP server on your device which you can then associate with a Windows drive(native Win7 example).

您还可以开发 Win7 驱动程序,使用 MTP 提供虚拟驱动器或在您的设备上运行 FTP 服务器,然后您可以将其与 Windows 驱动器关联本机 Win7 示例)。

回答by user2223403

You can try to install a WebDAV server to the android device, then mount the WebDAV server as a drive on Windows 7, after mounting to a drive, you can access the drive (android folder) from the command line.
Here is a free WebDAV server from Google Play (Of course, there are many other WebDAV servers in Google Play)
And the steps to mount the WebDAVserver as a drive on Windows 7

您可以尝试在Android设备上安装WebDAV服务器,然后在Windows 7上将WebDAV服务器挂载为驱动器,挂载到驱动器后,您可以从命令行访问该驱动器(android文件夹)。
下面是从谷歌Play免费WebDAV服务器(当然,还有许多其他WebDAV服务器的谷歌游戏
,那么安装步骤的WebDAV服务器的驱动器上的Windows 7

回答by localhost

On your Android device: Settings->More Settings...->USB Utilities Press "Connect storage to PC" button and plug USB cable. Then press "Turn on USB Storage" and you will see new Drive Letter in My Computer assigned to your Phone.

在您的 Android 设备上:设置->更多设置...->USB 实用程序 按“将存储连接到 PC”按钮并插入 USB 电缆。然后按“打开 USB 存储”,您将在“我的电脑”中看到分配给您手机的新驱动器号。

Now you can run ur command:

现在你可以运行你的命令:

D:\temp> mp3splt DRIVE_LETTER:\Podcast\program1.mp3 7.12 7.30 -d out -o program1Extract