How to Access Android Devices in Linux

Introduction
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:

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

UDEV Rule
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"

Fuse
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)

fuse:x:104:bill

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

Mounting
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.

Share — copy and redistribute the material in any medium or format
Adapt — remix, transform, and build upon the material
for any purpose, even commercially.

The licensor cannot revoke these freedoms as long as you follow the license terms.

Under the following terms:

Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.

ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.

No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.