我正在尝试将 Centos 7 操作系统连接到 Moto3G Android 手机(运行 Android v6 - marshmallow)
libmtp 已安装
Package libmtp-1.1.6-5.el7.x86_64 already installed and latest version
Nothing to do
互联网上的大多数搜索都建议使用 mtp-detect,但在我的情况下:
bash: mtp-detect: command not found
我可以使用 dmesg 看到手机
[ 6446.771306] usb 1-1.2: Product: XT1039
[ 6446.771309] usb 1-1.2: Manufacturer: motorola
我安装了 jmtpfs(使用 yum),它给了我以下内容
jmtpfs
No mtp devices found.
我尝试安装 go-mtpfs使用 GO 但得到以下内容
$ ./gopath/bin/go-mtpfs bob &
[1] 21633
$ 2017/05/03 13:06:18 detect failed: no MTP devices found
[1]+ Exit 1 ./gopath/bin/go-mtpfs bob
如果有人对这方面的进展有任何意见或建议,我将不胜感激。
最佳答案
在 CentOS 7 Linux OS 中访问 Android MTP 或其他 MTP 设备
Install mtp libs and utilities in CentOS
Login as root and install fuse, jmtpfs, libmtp as following:
$yum install fuse, jmtpfs, libmtp
安装/加载 MTP 格式设备的步骤(例如 android 7 nougat)
Login as root Create a directory to mount MTP device:
$mkdir /media/mtp-device
Connect android device to the USB cable, Unlock the android phone, Swipe down from the top of the phone screen. You should see a notification "USB ...", Tap that notification. You should see a menu titled "Use USB to...", select "Transfer files(MTP)" Option...
To list all the available mtp devices(eg. android 7 nougat), issue command jmtpfs in root session
$jmtpfs -l
each mtp device is listed with busnum, devnum information. Mount device as below:
$jmtpfs -device=<busnum>,<devnum> /media/mtp-device #If this option not specified, then the first device found isused.
or
$jmtpfs /media/mtp-device #All files will be present in /media/mtp-device location,but it will be accessible to the root only.
<强>2。从 MTP 设备访问/复制数据
Now you can access files of android devices mounted on /media/mtp-device folder, but you cannot copy to other folder. To copy files, you need to allow other user as below:
$jmtpfs -o allow_other ~/my-android7
Now you can copy the data from ~/my-android7 location to your folders.
3.从 Linux 系统移除或卸载设备
First un-mount the allow_other location
$fusermount -u ~/my-android7
Finally un-mount the device at root folder.
$fusermount -u /media/mtp-device
关于android-6.0-marshmallow - 将 Centos 7 连接到安卓手机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43759637/