How to Access Android Devices in Linux

How to Access Android Devices in Linux

22 Comments on How to Access Android Devices in Linux

If you have an android device that is not recognised when trying to access it via USB, this tutorial should help you. This technique is known to work for Iconia and Xoom tablets and is the result of researching many pages when I was trying to get my A501 tablet communicating via USB with Linux.

In Android
The first thing that needs to be done is to turn on USB debugging on the Android device. This option can be found by going to Settings -> Applications -> Development.

Install Packages
The MTPFS package now needs to be installed. It can be installed with the following command:

sudo apt-get install mtpfs

Device Vendor ID
To get the vendor id, plug in the Android device and use the command:


The output should look something like this:

bill@Mint64 ~ $ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 004: ID 0502:3344 Acer, Inc. 
Bus 002 Device 002: ID 04d9:0499 Holtek Semiconductor, Inc. Optical Mouse
Bus 002 Device 003: ID 1532:0109 Razer USA, Ltd Lycosa Keyboard
Bus 002 Device 004: ID 041e:30d3 Creative Technology, Ltd Sound Blaster Play!

In the same line as “Acer, Inc.” you will see the number 0502, that is where you will find the vendor id.

Open up nano or any other editor, you can use the following command for nano:

sudo nano /etc/udev/rules.d/51-android.rules

Add the following line to the file remembering to use the VendorID that was in the lsusb output where 0502 is:

SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0666"

The file fuse.conf needs to be modified, uncomment the line user_allow_other. The file can be edited with the following command:

sudo nano /etc/fuse.conf

You have to add your login name to the fuse group. Edit the group file:

sudo nano /etc/group

Look for the line fuse and add your name to it. It should look like this: (I added bill to the line)


Mount Point
The mount point can be anywhere and one that exists can be used. To create one in the “mnt” directory use the following commands: (use your username where bill is)

sudo mkdir /mnt/a501
sudo chown bill:bill /mnt/a501

The mount point can be added to fstab but I have created a small script to mount the drive and display the directory. If you are not using nautilus you need to change that line and if the mount point is not going to be /mnt/a501, that needs to be changed as well.

gksu -S --message "Enter your password to mount your Android device." "mount mtpfs /mnt/a501 -t fuse -o user,noauto,allow_other"
nautilus /mnt/a501/

About the author:

Bill Payne started working as a paid professional software developer at the young age of 12 years old developing simple games and other applications for pre-packaged computers. Bill has since developed software for many industries such as direct sales and the the stock market. Bill has now started sharing his many years of software development experience through a blog on the MPSHouse website and one on one lessons.


  1. Injury Attorney Bell Gardens  - 29 June , 2012 - 10:32 pm
    Reply /

    I was going through a similar issue where my android device wasn’t being recognized when I was trying to access it via a USB.

  2. Reply /

    […] Android device." "mount mtpfs /mnt/a501 -t fuse -o user,noauto,allow_other" nautilus /mnt/a501/ Source Share this:TwitterFacebookMorePinterestLinkedInTumblrRedditDiggLike this:LikeBe the first to like […]

  3. Malc  - 6 October , 2012 - 5:50 am
    Reply /

    This works… thanks !

    I was doubtful because many other sites are showing no progress here despite your page being up for 4 months. It sounded logical on reading and it certainly works.

    The only odd thing is subdirectories from both “internal and external” SD cards (to use androids very confusing naming, are both mixed together into the same directory (/mnt/android) in my case so just need to remember which is which. How come the internal /mnt paths are not shown ?

    This is on an Acer S500 (Ice Cream Sandwich)

    • bill  - 9 October , 2012 - 1:40 pm
      Reply /

      Glad you like the post, I have not looked into the mnt paths, I just needed a way to put media on my tab without needed to use a windows machine.

  4. Mark  - 1 November , 2012 - 1:41 am
    Reply /

    Thank you this worked great for my Nexus7 on Ubuntu 11.10.

  5. chadaplan  - 12 November , 2012 - 10:54 am
    Reply /

    Hello, thanks for the article… It’s [insert adjectives] that we have to go through this to connect our devices’ UNIVERSAL Serial Buses!!!

    I’m trying with my mobile (Sony Xperia ST21i, aka “tipo”, with Android 4.04 ICS), on Linux Mint 13 Maya (MATE, 32bit). I followed all of the steps without any trouble:

    – debug mode on
    – mtpfs installed
    – device id’d
    – udev rule added
    – fuse tweaked
    – mount point created, and
    – script executed

    But in the end I get the following error (translated from spanish):

    Couldn’t show «/media/ANDROID».

    Error: Error retrieving information of the file «/media/ANDROID»:
    The other endpoint of the connection isn’t connected
    Select another visor and try again.

    So… I’m stuck. I’d be glad to hear any ideas, thanks again!

  6. cesium62  - 14 November , 2012 - 7:44 am
    Reply /

    “Settings > Applications > Development” should presumably currently be “Settings > Developer Options”

  7. Daniel  - 16 November , 2012 - 8:51 am
    Reply /

    Not worked for me, the nautilus always say that the mobile is not connected.

  8. Sandy  - 21 November , 2012 - 5:59 am
    Reply /

    It works! I was able to connect my Acer Liquid Gallant Black (Android ICS). Thank you very much!!

  9. Greg  - 5 December , 2012 - 4:54 am
    Reply /

    Doesn’t work for me. I’m using Linux Mint 13 and HTC One V.

    “fuse: bad mount point `/mnt/androidhtc': Transport endpoint is not connected”

  10. Shon C  - 5 December , 2012 - 10:48 am
    Reply /

    Worked for me, I am running Texas Instruments OPAM tablet. For some reason it worked even despite me saving empty fstab file..

  11. oneoclock  - 1 January , 2013 - 6:01 pm
    Reply /

    mwah! I love this! I was finally able to mount my device to my machine!

  12. bancuri noi  - 5 January , 2013 - 11:39 am
    Reply /

    When some one searches for his vital thing, so he/she needs
    to be available that in detail, thus that thing is maintained
    over here.

  13. Vitus  - 14 January , 2013 - 5:51 am
    Reply /

    It would be nice, if you could help us out with the transport endpoint problem. I’ve got linux mint as well and im stuck…. thx

    • bill  - 14 January , 2013 - 2:12 pm
      Reply /

      It is very hard to help you with a problem I do not have. I did a quick search and there are many solved forum posts with transport endpoint problems.

  14. Raghuram Iyer  - 14 January , 2013 - 9:58 pm
    Reply /

    Ohhh thanks a lot bro!!!! i was searching the whole damn internet for this.ofcourse i have to do some tweaking as i use KDE rather than Gnome so gksu dont worked for me as i m using dolphin instead of nautilus.but still it worked at last so THANK YOU!! A LOT!!!

  15. Tarek MInt  - 25 March , 2013 - 9:26 am
    Reply /

    Thanks man, it works very well with my Xperia P under android 4.04 and Linux Mint 14.
    Great Job

  16. Shogatsu  - 3 February , 2014 - 3:42 am
    Reply /

    Thanks a lot, it works for me (xubuntu 12.10 with sony xperia SP android 4.1.2 – 254)
    I missed the udev rule, after saving the rules.d/file i restarted udev service and the magic appeared.

    You’re the boss

  17. Pouya K.  - 4 April , 2014 - 9:06 am
    Reply /

    Thanks for the article. It worked for me, BUT I got a mounted empty folder instead of files on my device. I think it is because my device only have SETTING > APPS > [no DEVELOPMENT and nothing like that]

    I have Sony Xperis SP with Android 4.3 and Linux Mint 13.

    Pouya Kashani

  18. Pouya K.  - 4 April , 2014 - 4:36 pm
    Reply /

    I got my answer here:

    How to enable Developer Options submenu(USB Debugging) on Android 4.2/Android 4.3/Android 4.4:

    Go to Settings menu on your device.
    Go to About submenu. In some devices the About submenu will be under “More”/”General” submenu. On some other devices(mostly HTC devices you will have to goto Settings> About> Software Information> More)
    Now scroll to “Build Number” and tap it 7 times.
    After tapping 7 times you will see an alert saying “You are now a developer”/”Developer mode has been enabled”.
    Now if you go to your Settings menu, you will see the developer options submenu over there.
    Tap on the Developer options and then turn on USB Debugging.

    So I hope I have helped you. Let me know if you have any doubts.

    Finally, I could mount my device, but I can’t transfer files easily. I think my Linux has a few problems!!! it freezed for a while and Caja (file manager) closed, etc.

    Anyway, I had a Samsung B5512 cell with Android 2.3 and before that, a Nokia N900 with Maemo OS, and I had no problem at all with them on this same linux. So, I will search to fix my new cell on this linux, works like those old ones 😉

    Thanks again for the article.


Leave a comment

Back to Top