You are not logged in.
Hello,
I already tried to mount a lot of Android phones always resulting to the same error.
Now I bought a new one and I want to connect this phone using the MTP protocol on the command line.
When I connect and unlock my phone using USB it is mounted automatically by gvfs.
So first I unmount it using the following code
$ sudo umount /run/user/1000/gvfs
Next I try any of the MTP commands always getting an error the device is not initialized.
$ mtp-detect
libmtp version: 1.1.17
Listing raw device(s)
Device 0 (VID=2717 and PID=ff40) is a Xiaomi Mi-2s (id2) (MTP).
Found 1 device(s):
Xiaomi: Mi-2s (id2) (MTP) (2717:ff40) @ bus 1, dev 10
Attempting to connect device(s)
error returned by libusb_claim_interface() = -6LIBMTP PANIC: Unable to initialize device
Unable to open raw device 0
OK.
What can I do to solve this problem?
Offline
Uninstall gvfs-mtp to ensure it doesn't automount, once anything has already taken control of an MTP device, all bets are off to get it working in another manner.
Is the phone unlocked and specifically put into transfer mode? that can often lead to issues. MTP is in general incredibly fickle, by design, save your sanity and use something network based for transferring files, there are many ftp servers for Android, or something like kdeconnect which will build up an sshfs tunnel, or enable developer mode so you can use adb directly
Offline
Thank you for the fast reply!
I uninstalled gvfs-mtp, rebooted my system, connected my phone, did unlock and selected File Transfer.
Now I am able to mount the device but the file listing is set to (NULL). Getting "Transport endpoint is not connected" error:
$ mtpfs -o allow_other mnt
Listing raw device(s)
Device 0 (VID=2717 and PID=ff40) is a Xiaomi Mi-2s (id2) (MTP).
Found 1 device(s):
Xiaomi: Mi-2s (id2) (MTP) (2717:ff40) @ bus 1, dev 8
Attempting to connect device
Android device detected, assigning default bug flags
Listing File Information on Device with name: (NULL)
$ ls mnt
ls: cannot access 'mnt': Transport endpoint is not connected
Offline
Using jmtpfs works for me.
Offline