Ensure you have the coorect software installed
sudo apt-get install libmtp-dev mtpfs
Before plugging in your device list your usb devices
lsusb
You should get output something like:-
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 002: ID 174f:14e8 Syntek Bus 001 Device 005: ID 045e:00db Microsoft Corp. Natural Ergonomic Keyboard 4000 V1.0 Bus 001 Device 004: ID 046d:c24e Logitech, Inc. G500s Laser Gaming Mouse Bus 001 Device 003: ID 8087:0a2b Intel Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Plug in your device and do it again
lsusb
Now find the extra line (device 10 in this example)
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 002: ID 174f:14e8 Syntek Bus 001 Device 005: ID 045e:00db Microsoft Corp. Natural Ergonomic Keyboard 4000 V1.0 Bus 001 Device 004: ID 046d:c24e Logitech, Inc. G500s Laser Gaming Mouse Bus 001 Device 003: ID 8087:0a2b Intel Corp. Bus 001 Device 010: ID 2a70:f003 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Use this data to update the definitions file
Bus 001 Device 010: ID 2a70:f003
Edit the file
sudo vi /lib/udev/rules.d/69-libmtp.rules
Add a line like
ATTR{idVendor}=="vendor-id", ATTR{idProduct}=="product-id", SYMLINK+="libmtp-%k", MODE="660", GROUP="audio", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1", TAG+="uaccess"
So in this example
# OnePlus 5 ATTR{idVendor}=="2a70", ATTR{idProduct}=="f003", SYMLINK+="libmtp-%k", MODE="660", GROUP="audio", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1", TAG+="uaccess"
Restart the usb device service
sudo service udev restart
Disconnect and reconnect your device and you are away.
Wow, thank you very much for covering this masterpiece article.
I have a situation about my Oneplus 5 VS Fedora 34 are in detail: https://ask.fedoraproject.org/t/failed-to-use-adb-command-in-oneplus-5-through-fedora-34/14881/17 (If you can comment on that post, or replay over here, it would mean a lot.)
I’m trying to do this. It’s been three days, but I still could get this job done.