如何让三星 Galaxy S5 在 Debian 9 上使用 MTP?

mYn*_*EAm 9 usb debian file-copy android mtp

所以我正在尝试使用 MTP 而不是 KDE Con​​nect 在带有 Android 的三星 Galaxy S5 和我的 Debian9/KDE 机器之间共享文件。

问题是我不断收到:

mtp 协议的进程意外终止。

尝试复制文件时。

也常说

未找到存储。也许您需要解锁您的设备?

尝试一段时间后,我可以在 dolphin 中查看手机的一些内容:当手机上的对话框要求它时按“允许”,同时尝试在 dolphin 中打开它,它正确地将其检测为三星 Galaxy S5。

我曾经可以成功复制一堆图像。

我已经试过了sudo apt-get install --reinstall libmtp-common。syslog 有如下内容:

usb 1-5: usbfs: process 7907 (mtp.so) did not claim interface 0 before use
usb 1-5: reset high-speed USB device number 35 using xhci_hcd
usb 1-5: usbfs: process 7909 (mtp.so) did not claim interface 0 before use
colord-sane: io/hpmud/pp.c 627: unable to read device-id ret=-1
usb 1-5: USB disconnect, device number 35
usb 1-5: new high-speed USB device number 36 using xhci_hcd
usb 1-5: usbfs: process 7930 (mtp.so) did not claim interface 0 before use
usb 1-5: usbfs: process 7930 (mtp.so) did not claim interface 0 before use
usb 1-5: usbfs: process 7930 (mtp.so) did not claim interface 0 before use
Run Code Online (Sandbox Code Playgroud)

GAD*_*D3R 6

安装jmtpfs

apt install jmtpfs
Run Code Online (Sandbox Code Playgroud)

编辑你/etc/fuse.conf的如下

# Allow non-root users to specify the allow_other or allow_root mount options.

user_allow_other
Run Code Online (Sandbox Code Playgroud)

创建 udev 规则。使用lsusbmtp-detect获取您设备的 ID

nano /etc/udev/rules.d/51-android.rules
Run Code Online (Sandbox Code Playgroud)

与以下行:

SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", MODE="0666", OWNER="[username]"
Run Code Online (Sandbox Code Playgroud)

04e8and替换6860为你的,然后运行:

udevadm control --reload
Run Code Online (Sandbox Code Playgroud)

重新连接您的设备,打开终端并运行:

mkdir ~/mtp
jmtpfs ~/mtp
ls ~/mtp
Run Code Online (Sandbox Code Playgroud)

示例输出:

Card  Phone
Run Code Online (Sandbox Code Playgroud)

要卸载您的设备,请使用以下命令:

fusermount -u ~/mtp
Run Code Online (Sandbox Code Playgroud)

您也可以使用该go-mtpfs工具:

通过 FUSE 挂载 MTP 设备

mkdir ~/mtp
go-mtpfs ~/mtp
Run Code Online (Sandbox Code Playgroud)

用于挂载设备的图形工具gmtp::

用于基于 MTP 的设备的简单文件传输程序

sudo apt install gmtp
gmtp
Run Code Online (Sandbox Code Playgroud)

kio-mtp

使用 KDE 平台为应用程序访问 MTP 设备

  • 我真的很想将您的答案标记为解决方案,但它对我不起作用。因此我不得不使用 KDE Con​​nect。多次重新运行命令后,我收到错误,包括:`jmtpfs ~/mtp2` `ignoring libusb_claim_interface() = -6PTP_ERROR_IO: 无法打开会话,重置 USB 接口后重试 LIBMTP libusb: Attempt to reset device` `ls: cannot访问“/home/username/mtp”:输入/输出错误``fusermount:无法卸载/home/username/mtp:设备或资源繁忙`。一旦 `ls ~/mtp` 显示正确的内容,并且一旦我可以在 dolphin 中查看 SD 卡上的文件。 (2认同)