Android MTP and ubuntu

Finally i configured my mint 13 (ubuntu 12.10 should be same) to seamlessly mount android mtp devices.

Out of all the options (mtpfs, gvfs-mtp, gmtp) go-mtpfs made by some googler seems to be the most stable along with the specific libmtp9 version.

The easiest way is to just use the following ppa (thanks http://www.webupd8.org ).


sudo add-apt-repository ppa:webupd8team/unstable
sudo apt-get update
sudo apt-get install go-mtpfs

Then create a udev rule (use your own editor i use emacs)


sudo emacs /etc/udev/rules.d/90-android.rules

And add following lines


# Samsung Galaxy Note 10.1 MTP mode
ATTR{idVendor}=="04e8", ACTION=="add", ENV{ID_MODEL}="GalaxyNote10"
# Samsung Galaxy Note 10.1 : automount when plugged in
ENV{ID_MODEL}=="GalaxyNote10", ACTION=="add", RUN+="/usr/bin/sudo -u root /bin/bash -c 'mkdir /media/android-mtp ; /usr/bin/go-mtpfs -allow-other=true /media/android-mtp &'"
# Samsung Galaxy SIII : umount when unplugged
ENV{ID_MODEL}=="GalaxyNote10", ACTION=="remove", RUN+="/usr/bin/sudo -u root /bin/bash -c '/bin/fusermount -u /media/android-mtp; rmdir /media/android-mtp'"

This will work for any samsung phone. If yours is different then check your vendorID with lsusb and use that in the second line above.

Note: you won't be able to unmount the attached device from desktop (atleast with nautilus/nemo). But just yanking device out should work. And since its mtp you don't really need to unmount.

Note2: go-mtpfs uses /tmp/go-mtpfsXXXX as its cache area so make sure you have plenty of space there (basically enough to cache all the phone folders you are accessing). It will fail and act weird otherwise.

Note 3: Although not really experienced by me it seems go-mtpfs works best when phone is unlocked. I use tasker to keep the phone unlocked when usb is plugged in. But simple unlock while plugging in the phone works as well. Also i have not tested what happens if phone goes locked while you are doing data transfers.