Connecter un périphérique Android en utilisant MTP sous Debian

Tout d'abord, nous devons installer un certain nombre de paquets

apt-get install libmtp-common mtp-tools libmtp-dev libmtp-runtime libmtp9

Ensuite, dans un terminal , éditez le fichier /etc/fuse.conf et décommentez la ligne suivante

user_allow_other

Connecter votre périphérique en USB et exécuter la commande suivante pour obtenir le Vendor ID et le Product ID

# lsusb
Bus 003 Device 006: ID 8087:07dc Intel Corp.
Bus 003 Device 004: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 003 Device 009: ID 0fce:01a7 Sony Ericsson Mobile Communications AB
Bus 003 Device 005: ID 1516:8628 CompUSA Pen Drive
Bus 003 Device 003: ID 413c:2513 Dell Computer Corp. internal USB Hub of E-Port Replicator
Bus 003 Device 002: ID 8087:8000 Intel Corp.
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 413c:5534 Dell Computer Corp.
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 046d:c018 Logitech, Inc. Optical Wheel Mouse
Bus 001 Device 003: ID 046d:c312 Logitech, Inc. DeLuxe 250 Keyboard
Bus 001 Device 002: ID 413c:2134 Dell Computer Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Editer le fichier /lib/udev/rules.d/69-libmtp.rules et ajouter le contenu suivant (adapter les zones en gras selon votre périphérique et les Vendor ID et Product ID)

# Sony Xperia Z1
ATTR{idVendor}=="0fce", ATTR{idProduct}=="01a7", SYMLINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"

Redémarrer le service Udev

sudo service udev restart