While Ubuntu does many things well out of the box, being able to recognize Android devices connected by USB is not one of them.  Instead the devices have to be added by manually editing the rules of the USB subsystem.  Luckily, this is easy to fix.

First you need to determine the right ID for your device (you can find a list of the most common vendor IDs at the end of this post).

Next, using your favourite editor as root edit (or create) "/etc/udev/rules.d/51-android.rules” and add this line:

SUBSYSTEM=="usb", SYSFS{idVendor}=="<your vendor's four character id>", MODE="0666"

Save the file and exit the editor, then set the permissions of the file and restart the udev system:

$ sudo chmod a+rx /etc/udev/rules.d/51-android.rules
$ sudo restart udev
udev start/running, process xxxx

Plug in your Android device and turn on USB storage.  Your SD card will now be mounted just like any other USB drive in Ubuntu.  An easy fix!


Android Company Vendor IDs

From the Android Developers vendor id list:

Company Vendor ID
Acer 0502
ASUS 0b05
Dell 413c
Foxconn 0489
Fujitsu 04c5
Fujitsu Toshiba 04c5
Garmin-Asus 091e
Google 18d1
Hisense 109b
HTC 0bb4
Huawei 12d1
K-Touch 24e3
KT Tech 2116
Kyocera 0482
Lenovo 17ef
LG 1004
Motorola 22b8
NEC 0409
Nook 2080
Nvidia 0955
OTGV 2257
Pantech 10a9
Pegatron 1d4d
Philips 0471
PMC-Sierra 04da
Qualcomm 05c6
SK Telesys 1f53
Samsung 04e8
Sharp 04dd
Sony 054c
Sony Ericsson 0fce
Teleepoch 2340
Toshiba 0930
ZTE 19d2

If your device is not listed, you can determine your vendor ID using the lsusb command:

$ sudo lsusb
Bus 010 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 002: ID 047f:d055 Plantronics, Inc.
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 010: ID 0bb4:0c02 High Tech Computer Corp.
Bus 002 Device 004: ID 046d:c505 Logitech, Inc. Cordless Mouse+Keyboard Receiver
Bus 002 Device 003: ID 046d:0809 Logitech, Inc.
Bus 002 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB

If you can’t tell which entry is for your Android device, run lsusb once with the phone connected and once without and the entry that appears in one list but not the other will be the one you’re looking for.  In this instance, the connected Android device is an HTC G1 (aka Dream), so the vendor ID is 0bb4.

Note: for some devices, such as the latest Kindle Fire on Ubuntu 12.04, you’ll need to install the MTPFS libraries and create a directory to mount the SD card as the devices use a different interface method:

$ sudo apt-get install mtpfs
$ mkdir ~/KindleFire
$ mtpfs ~/KindleFire
$ nautilus ~/KindleFire &