How do I transfer files between Android and Linux over USB?

185,473

Solution 1

UPDATE: There are several, better alternatives to Airdroid now. However, it seems most Linux distros are now working with MTP fairly well. I know in my experience, Mint (Ubuntu based) works out of the box, as does Manjaro (Arch based). If it doesn't work out of the box or natively, then be sure to search your package manager for an MTP solution.


Newer versions of Android mount storage as an MTP device instead of mass storage. The benefit to this is simultaneous access on the Android device and the PC. Unfortunately, while Windows supports it natively just fine, linux solutions are fairly buggy as of right now.

Currently, the most reliable (and it still is a little flaky to get going, but once connected is fine) that I have found is go-mtpfs. Here is a link to help you get it set up. You have to mount/dismount from command line. There is also a unity launcher in that thread if you're on Ubuntu unity, however.

The best option, though, unless you are transferring a lot of data, is to use something like AirDroid. It is a free app in the play store for local network transfers, and provides a web interface to use with your computer's browser. It even provides a drag and drop file interface, as well as even allowing access for sms messaging, call logs, app installs, and many other things.

Solution 2

You could try using the free (gratis) ES File Explorer file manager on your Android phone.

Among a lot of functionality, it has an FTP server. So, if you can network your phone and your computer, you can easily transfer files both ways from your computer. I do it all the time from Ubuntu and Fedora machines (via Thunar).

The FTP server mode in this app is called "Remote Manager", it's under the Tools section.

Most modern file managers will accept the following syntax:

ftp://phone_ip_address:port

Solution 3

mtpfs - FUSE filesystem for Media Transfer Protocol devices

apt-get install mtpfs

Done. Works as with Windows in Linux Mint/Ubuntu/etc.

Solution 4

After looking for a bunch of solutions to this problem, I've found Android File Transfer for Linux. This is the best MTP implementation for Linux, it just works.

You can see that this problem has been stated in The List of Major Linux Problems on the Desktop.

Linux doesn't have a reliably working hassle free fast native (directly mountable via the kernel; FUSE doesn't cut it) MTP implementation. In order to work with your MTP devices, like ... Linux based Android phones you'd better use ... Windows or MacOS X. Update: a Russian programmer was so irked by libMTP he wrote his own complete Qt based application which talks to the Linux kernel directly using libusb. Meet Android-File-Transfer-Linux.

Solution 5

Here's another very easy way. If you have xfce4 installed, run thunar. It just works. No mount-ing no mtp-ing. You can drag and drop in the thunar windows.

I have a full install of Slackware, so Xfce is just there even though I never use it as a desktop. It doesn't eat up disk space and is occasionally useful.

NB: You have to tell the phone to use USB for file transfer or PTP so that thunar can see it. On my OnePlus5 android 9, there's a notification when I plug in the USB cable that allows me to choose connection options.

Share:
185,473

Related videos on Youtube

lamwaiman1988
Author by

lamwaiman1988

Updated on September 18, 2022

Comments

  • lamwaiman1988
    lamwaiman1988 over 1 year

    I want to copy some movie files from Linux to my HTC One SV Android phone (not rooted).

    In Windows, my phone mount its internal and SD-card volumes automatically when I plug it in, allowing me to transfer files.

    In Linux Mint 13 Mate, I always get an error when I plug my phone in with a USB cable, then it may take some minutes to mount, and it sometimes fails. I think the error was—

    Error initializing camera: -60: Could not lock the device

    How can I make this work?

  • lamwaiman1988
    lamwaiman1988 over 10 years
    I installed the latest version Linux Mint 15 Olivia as the team stated they made effort into android connection. I tried the usb connection it is working just fine. Much better than Linux Mint 13. So I think it is just problem of linux with MTP transfer and the performance varies between distros.
  • user66631
    user66631 about 10 years
    Ash is right, thanks for the tip!, it works fine. To transfer mp3 files, you have to press (on the mobile) where it says connect to usb; when you do that, rythym box or other program will open. Then you just drag your files from rhythm box to where it says DEVICE in rhythm box. The files will be in your mobile in a folder called Music. You can see the all your folder files on your desktop pressing the icon of your device.
  • Stefan van der Walt
    Stefan van der Walt over 9 years
    For increased speed, you can also use adb pull as outlined in this post: vxlabs.com/2014/11/06/…
  • Jayzb73
    Jayzb73 over 9 years
    Regarding the above, this PcWorld review was ironic: "This app allows you to take complete control of your Android device via your computer’s Web browser."
  • Erik255
    Erik255 over 9 years
    sudo apt-get install jmtpfs on jessie
  • Jake Alsemgeest
    Jake Alsemgeest over 9 years
    it's jmptpfs also on wheezy.
  • sybind
    sybind about 9 years
    AirDroid is now charging now for the local file transfer "feature".
  • Edward Falk
    Edward Falk almost 9 years
    Unfortunately, newer versions of Android don't support mass storage mode. Only mtp (or ptp in some cases). Linux doesn't support mtp very well.
  • Ash
    Ash almost 9 years
    @Edward: yes, you're right. After I "upgraded" from Galaxy S2 to S3, mass storage mode was no longer available. As Drake says in the accepted answer, I've found MTP to be flakier than mass storage so it's a bit unfortunate, but once you get it to work it's okay I guess. I'm using gMTP as a GUI client which works okay but it's fairly slow.
  • Edward Falk
    Edward Falk almost 9 years
    FWIW, I found the "Ftp Server" app to be perfect for my needs. It's dead simple to use, and allows you to do ftp transfers to your device via local network or USB
  • Jeff Schaller
    Jeff Schaller almost 8 years
    Is that the extent of the solution?
  • Robby Lebotha
    Robby Lebotha almost 8 years
    It is what worked for me, literally ran the command, was prompted to restart and once I logged in again I could read/write files on my android device using dolphin file manager. I didn't have to do anything else or change edit files.
  • Robby Lebotha
    Robby Lebotha almost 8 years
    Im running Xubuntu with KDE Plasma 5 on my Asus ux303
  • nealmcb
    nealmcb over 7 years
    You should add that info to the text of your answer, which is incomplete and confusing without it
  • will
    will about 7 years
    I have Mint 18.2 ... It does NOT always work and is Always Slower than any Dog. Further more a simple copy FREEZE-s the machine (even a Bash shell) until the transfer completes. That's just an outrage, when the same operation from a Windows PC is almost unnoticeable.
  • thomp45793
    thomp45793 over 6 years
    With respect to MTP consider gMTP. It's advertised as a media player but supports MTP transfers. I found it useful when relying on MTP to upload files onto an Android tablet.
  • Admin
    Admin about 6 years
    Now it's under the Network section.
  • Exadra37
    Exadra37 about 5 years
    no need to rsync,,, the copy command is enough cp -r /run/user/1000/gvfs/mtp\:host\=%5Busb%3A002%2C010%5D/ ~/Destination/Folder. I say this in the context of doing the only a copy, off-course if is to to update your PC with the latest photos taken, then rsync is the way to go.
  • hackerkatt
    hackerkatt over 4 years
    A number of comments suggest to install mtp-tools. Not saying that's not necessary. I believe the first step is to ensure the USB settings are set to allow for File Transfer before installing additional packages. In my case I installed libmtp9 (needed in 19.04 LTS) and mtp-tools. I simply got Unable to open raw device 0 error message. Uninstalled mtp-tools, enabled USB settings and viola file browser popped up with Pixel storage device like any other drive.
  • Alexis Wilke
    Alexis Wilke over 2 years
    That looks great, better than the default MTP system in the nautilus. But it doesn't look like that helps with newer Pixel 5 phones... that one is still invisible.