Transfer files between phone and computer via USB
Connect an Android phone to a computer by USB cable and transfer files using MTP (Media Transfer Protocol) mode.
Let's go!
Activate developer mode on the phone (example: my device is a Moto G7 Power). Go to Settings->About phone and quickly tap seven times on Build number. When the message appears "You are now a developer" you are all set to proceed to the next step.
Go to Settings->System->Advanced->Developer options->Default USB configuration and switch No data transfer
to File Transfer
.
On my computer (running Debian), I install jmtpfs ...
$ sudo apt install jmtpfs
Create mountpoint for the phone in the home directory ...
$ mkdir -p ~/mnt/phone
Unlock the phone. Connect the unlocked phone to the computer with a USB cable. Confirm system detects the phone ...
$ jmtpfs -l
Device 0 ...
Mount the phone ...
$ jmtpfs ~/mnt/phone/
Device 0 (VID=22b8 and PID=2e82) is a Motorola Moto G (ID2).
Android device detected, assigning default bug flags
Phone storage is now accessible to all the standard Linux tools.
When finished and before disconnecting, unmount the phone ...
$ fusermount -u ~/mnt/phone
Link: mtp - Debian Wiki
» Next: Nginx web server
« Previous: Put a modem-router in bridge mode