Есть mtp для линукс

Как заставить работать MTP

MTP — это наверно самое глючное подделие на Linux, какое я еще не видел. Попробывал все, от mtpfs до android-fle-transfer. Все пакеты которые были для mtp поставил. Rules добавлял. В группу uucp юзера добавил. И все равно не пашет. Да понятно, что лучше пользоваться ssh или rsync. Но вот жена и родня и другие домохозяйки не умеют нечего подобного. Поэтому хотелось бы все таки побороть MTP. Скажите, что еще надо сделать, чтоб этот MTP заставить работать?!

Ubuntu обновить. Использовать попсовое DE – GNOME

И всё будет более-менее из коробки.

Забей на это поделие проприетарщмков, покусанных копирастами. Используй kdeconnect, он рулит и педалит.

У меня были похожие проблемы, только несколько лет назад.
Пользуюсь KDE, оно там вроде встроено, никаких проблем с MTP.
Ну и конечно KDEConnect рулит и педалит.

А что, MTP уже умеет не зависать намертво при передаче >10 файлов?

И в последних версиях жрёт батарею на телефоне. А ещё скорость ниже, чем по MTP.

По теме: использую Android File Transfer; просто установил — просто работает (Fedora, KDE).

Вот сколько лет пользуюсь, такого не видел.

Хотя, конечно, доступ к хранилищу как к стандартной флешке был бы лучше.

Использую тот что в KDE. Бажный, но в целом терпимо.

Если все установлено и настроено, после подключения, устройство нужно разблокировать и в шторке ткнуть в уведомление «Зарядка через USB» изменить на «Передача файлов по MTP».

Соответствующие пользователи должны находиться в группе storage (в gentoo это группа plugdev).

MTP — это наверно самое глючное подделие на Linux, какое я еще не видел

Media Transfer Protocol (MTP)[1] — основанный на PTP[en] аппаратно-независимый протокол, разработанный компанией Microsoft для подключения цифровых плееров к компьютеру.

«это наверно самое глючное подделие на Linux» разработанный компанией Microsoft ну ты понил да.

Скажите, что еще надо сделать, чтоб этот MTP заставить работать?!

Не знаю у меня оно просто работает. И да не без глюков но это зависит от множества вещей засим похрен. И да adb никто не запрещал если что.

Не знаю как у вас в криокамере, а на Ubuntu 18.x всё Ок с MTP. На той, что уже с Gnome вместо Unity. На arch с последним гномом тоже MTP пашет на ура из коробки.

В консоли пердоль mtp-send или как там его.

В консоли пердоль mtp-send adb push или как там его.

Источник

Media Transfer Protocol

The Media Transfer Protocol (MTP) can be used to transfer media files to and from many mobile phones (all Windows Phone 7/8/10 devices, most newer Android devices) and media players (e.g. Creative Zen).

Contents

Connecting

To connect your computer to a device via MTP:

  • the device needs to be connected to your computer via USB
  • MTP needs to be enabled on the device
  • the device’s screen needs to be unlocked (for security reasons)

FUSE filesystems

The following programs let you access MTP devices via a FUSE filesystem.

For the FUSE-based file systems, you might need to create the mount-point directory first. The directory

/mnt is used in the examples below.

FUSE mounts can generally be unmounted using fusermount -u mountpoint .

Android File Transfer

Android File Transfer — MTP client with CLI, Qt UI, and FUSE wrapper which uses a custom MTP implementation

Mount your device on

If you want album art to be displayed, it must be named albumart.xxx and placed first in the destination folder. Then copy other files. Also, note that fuse could be 7-8 times slower than ui/cli file transfer.

Читайте также:  Sp flash tool linux download

If you want to interact with it via the command line interface, run the command:

Type help in order to list all the commands available, exit to quit.

If you want to interact with it via the graphical user interface, start the android-file-transfer application, choose a destination folder and click any button on the toolbar. Available options are: Upload Album, Upload Directory and Upload Files. The latter two are self-explanatory. Upload album searches the source directory for album covers, and sets the best available cover.

MTPfs

MTPfs — based on libmtp, it is a FUSE filesystem that supports reading and writing from any MTP device

First edit your /etc/fuse.conf and uncomment the following line:

Mount your device on

jmtpfs

jmtpfs — based on libmtp for accessing MTP (Media Transfer Protocol) devices

Mount device on

Make this cohere to the rest of Linux (use regular mount/umount commands) by doing two steps

add this line to /etc/fstab ;

Now mount the device and see if the options «took»

SIMPLE-MTPFS

SIMPLE-MTPFS — based on libmtp Simple Media Transfer Protocol FileSystem is a file system capable of operating on files on MTP devices attached via USB to local machine

Run simple-mtpfs -l to list detected devices.

To mount the first device in the list to

/mnt , run simple-mtpfs —device 1

go-mtpfs

go-mtpfs — FUSE filesystem with custom MTP implementation, written in Go

Install android-udev , which will allow you to edit /etc/udev/rules.d/51-android.rules and apply to your idVendor and idProduct , which you can see after running mtp-detect. To the end of the line, add your user OWNER=» » .

Mount device on

libmtp

libmtp is a library MTP implementation, which also comes with some example command-line tools (which you can list using pacman -Ql libmtp ).

Run mtp-detect to detect your device.

If an error is returned, make sure your user is in the uucp user group.

You can transfer files using the mtp-connect command.

Frontends

gMTP — A graphical frontend for libmtp. It lets you connect to Android devices and manage files using a desktop agnostic GUI.

Media players

You can also use your MTP device in music players such as Amarok. To achieve this, you might have to edit /etc/udev/rules.d/51-android.rules (the MTP device used in the following example is a Galaxy Nexus). Run:

Search for your device. It should be something like that:

And entry to /etc/udev/rules.d/51-android.rules will be this:

Also reload udev rules:

File manager integration

To view the contents of your Android device’s storage via MTP in your file manager, install the corresponding plugin:

  • For file managers that use GVFS (GNOME Files), install gvfs-mtp for MTP or gvfs-gphoto2 for PTP support.
  • For file managers that use KIO (KDE’s Dolphin), MTP support is included in kio-extras (dependency of dolphin).

After installing the required package, the device should show up in the file manager automatically and be accessible via an URL, for example mtp://[usb:002,013]/ .

gvfs-mtp

This article or section is a candidate for merging with udev.

The gvfs-mtp is available in the official repositories.

With lsusb you can get information about your device where Bus and Device numbers can be used with gvfs-mtp and device ID for creating of an udev rule.

To see detected device with enabled MTP

To mount all available connected MTP devices use inline script

To mount or dismount from a command with gvfs-mtp use Bus and Device numbers, e.g. to mount gio mount mtp://[usb:001,007]/ and to unmount gio mount -u mtp://[usb:001,007]/ . The mounted device will be available in a directory that begins with mtp:host= and is located under /run/user/$UID/gvfs/.

Disable automount of MTP devices with gvfs you will need to change value true to false for variable AutoMount that is located in /usr/share/gvfs/mounts/mtp.mount .

If your device is not showing up in the file manager then #libmtp is missing a native support and is not currently available in the list of the supported devices. If you will try to mount by using command line you may also get an error

The workaround to make it shown in the file manager is to write an udev rule for the device but it is no guaranty that you will be able to mount it with by using MTP connection.

Читайте также:  System windows window close

Use ID number that represents by pattern vendorId:productID,e.g. 04b7:88a9, and make an udev rule by creating a configuration file

Reload the udev rules.

The file managers with support for gvfs will be able to show MTP devices and mount them if supported by #libmtp but if has no support and cannot be opened then change settings in the phone to PTP and install gvfs-gphoto2 for having access at least to the photos, command line mounting of PTP is a little similar to mounting of the MTP devices: gio mount gphoto2://[usb:002,019]/ .

Troubleshooting

libmtp (gvfs-mtp): filemanager (nautilus, pcmanfm, vifm and etc) hangs on accessing DCIM/Camera of Android device

Symptoms: everything works fine till moment of entering DCIM/Camera directory. In this case filemanager freezes and even in command line you cannot run even ls on that directory.

Possible and very probable reason is the bug of libmtp.

It seems that it is caused by file with name like 20180915_180351(0).jpg . Samsung phones for example like to create files with such names.

There are several tickets (one, two and etc) and questions (one, two) about it.

So possible workaround is to use different mtp option from #FUSE filesystems like go-mtpfs for such directories or somehow change file naming policy of your phone camera (or switch to another camera app like Open Camera for example).

jmtpfs: Input/output error upon first access

Symptoms: jmtpfs successfully mounts, but as soon as one attempts to access files on the device (e.g. via ls ), an error is reported:

This appears to be a security feature: MTP does not work when the phone is locked by the lockscreen. Unlock the phone and it should work again as long as the cord remains connected.

kio-mtp: cannot use «Open with File Manager» action

If you are not able to use the action «Open with File Manager», you may work around this problem by editing the file /usr/share/solid/actions/solid_mtp.desktop .

Change the line Exec=kioclient exec mtp:udi=%i/ to Exec=dolphin «mtp:/» .

kio-mtp being called simultaneously by different services

Parallel usage of mtpfs and kio-mtp, as well as conflicting services using kio-mtp -music players included- should be avoided, as mentioned in this forum.

Amarok’s plugin for MTP services, for example, might be preventing Dolphin (plasma) to access different phone model’s files. Switching it off was a solution for at least one user.

Android File Transfer: connect failed: no MTP device found

After installing android-file-transfer , while trying to mount any MTP device if you get the following error:

then install the package: android-udev . This package contains per manufacturer/device udev rules for MTP devices, making it easier to use ADB or MTP.

Источник

Desktop support

GNOME

GNOME applications (like GNOME_Files and Archive_Manager) use GIO-based GVFS (the GNOME virtual file system) to mount MTP volumes and access files on MTP devices:

  • launch on attaching your device (e.g., with USB cable)
  • interact with an attached device (e.g., by double-clicking the device’s icon in the device list).

KDE Plasma

KDE uses the MTP KIO Slave with a similar level of integration as GVfs. This requires the kio-extras package to be installed. When a phone is connected and set to transfer files with MTP, KDE will open the Device Notifier and show an entry for it. From here, you can take actions such as opening it as a folder in Dolphin, or viewing the photos on your device through Gwenview.

Others

A desktop-agnostic tool that allows you to simply mount and manage files on MTP-connected devices is gMTP, which can be obtained by installing the gmtp package.

libmtp

libmtp provides support for MTP devices. Its device support changes with each version of its code, thus you may need a particular version of libmtp (or greater) to support your particular device: e.g., the MotoG phone is not supported directly before libmtp version == 1.1.8 per its maintainers.

Читайте также:  Файловая система линукс для начинающих

Commandline

Several tools provide a FUSE based file system for mounting MTP devices within the Unix filesystem hierarchy, making it accessible to any program that operates on files and directories. Examples include mtpfs, jMTPFS, go-mtpfs and simple-mtpfs, etc.

install package name= mtp-tools

TODO: document usage, but see below.

Uses FUSE to mount your device’s MTP structure into a POSIX filesystem, and fusermount to unmount the device.

    install package name= jmtpfs

    create as your mount point: $ mkdir -p

    make sure you have write access to : $ sudo chown $USER:$USER

    to mount your device: $ jmtpfs

    On some MTP devices: your screen must be unlocked in order to mount. However, you might get a (spurious) input/output error even if the screen is unlocked.

to unmount your device: $ fusermount -u

mtpfs has been orphaned since Squeeze, anyway mtpfs is very similar to jmtpfs, except for the executable name, package name, and package status

    install package name= mtpfs

    to mount your device: $ mtpfs

    to unmount your device: $ fusermount -u

testing and debugging device connection

Connect your target device (e.g., Android phone) to your Debian host (e.g., laptop) via USB cable, and unlock the target device. Relatively quickly, you should see the following:

Your Debian host’s desktop should open a file browser (e.g., a nautilus window) showing the browsable contents of a location. If the location is mounted in your filespace, you should not need to read further from this article. Alternatively, the location will be shown with a URI beginning with mtp://, which will not be mounted, but can be manipulated via the usual means provided by your file browser (including copying and deleting files). If you wish to actually mount that location (i.e., your target device), read on.

  • The target device may also show some GUI, such as choosing the connection mode. If so, choose mode=MTP.
  • If neither of those occur, you should

      Check your connection, e.g., the USB cable. If fixing that does not make your target device browseable as described above, then .

    Check which version of libmtp and associated packages you have installed on your Debian host: see following section=device statuses. Install them if not already done. You will minimally need to have the executable mtp-detect in your path.

    Run mtp-detect from your host with your target device attached.

    If you see results like

    . stop and seek help elsewhere. If you see results like

    . your target device is not currently supported. As noted in the result, you should report it to the libmtp maintainers by making a feature request like this one.

    If you see results like

    then you should be able to mount the target device onto your host’s filespace as discussed in the following example.

    Example: laptop, MotoG, USB, libmtp, jmtpfs

    device statuses

    I have a (working) 1st-generation Motorola MotoG running Android version=4.4.4 that I wish to mount on a Debian laptop. Latter has

    Note that libmtp version >= 1.1.8 supports the MotoG per its maintainers. After fiddling with APT and my repositories, I have

    setup/check Debian host

    With no MTP devices connected to the laptop, I see (from the laptop)

    successful jmtpfs mount

    I then unlocked the MotoG’s screen and connected it to the laptop with a USB cable.

    Immediately upon connecting, a nautilus window opened on the laptop showing the browsable contents of location= mtp://[usb:001,040]/ with device name= XT1028. I can also see (from the laptop)

    I can then mount the MotoG’s storage with

    . and unmount the MotoG’s storage with

    failed jmtpfs mount

    I initially tried to mount the MotoG using sudo. Don’t do that! You’ll get results like

    Remember: MTP filesystems are implemented as FUSE, which means Filesystem in your Userspace.

    copy files off your smarphone with mtp-getfile

    First install the mtp-tools package:

    Then get the list of available files:

    file_list.txt will now contain entries like this:

    where «Parent ID» is something like the folder where the file resides on the smartphone. So you’ll want to do something like this to get that particular file:

    Yes, the mkdir «12» and the 12 from the Parent ID in the local file is important.

    Источник

    Оцените статью