Access Android Devices in FreeBSD 11

I know a couple of ways to do this, both on CLI and via a GUI based application. The GUI based app is called GMTP but here we’re going to use simple-mtpfs(1). As what the name of the programs says it’s simple so let’s just dive into it.

Install and Configure MTPfs

First, we need to install a package called fusefs-simple-mtpfs. To install its binary package via pkg(8), just type in your terminal:

sudo pkg install fusefs-simple-mtpfs

To install it via ports:

cd /usr/ports/sysutils/fusefs-simple-mtpfs && sudo make install clean

Now open up /etc/devfs.rules (if it doesn’t exists create it) and add these lines of codes:

[system=10]
add path 'usb*'         mode 0770 group cups
add path 'ugen*'        mode 0660 group cups
add path 'ad[0-9]\*'    mode 0666
add path 'ada[0-9]\*'   mode 0666
add path 'da[0-9]\*'    mode 0666
add path 'acd[0-9]\*'   mode 0666
add path 'cd[0-9]\*'    mode 0666
add path 'xpt[0-9]\*'   mode 0666
add path 'mmcsd[0-9]\*' mode 0666
add path 'pass[0-9]\*'  mode 0666
add path 'usb/\*'       mode 0666
add path 'ugen[0-9]\*'  mode 0666

For good measure, make sure you have these modules in your /boot/loader.conf as well:

fuse_load="YES"
autofs_load="YES"

You can load them both in the kernel manually so you don’t have to reboot by typing in:

sudo kldload fuse && sudo kldload autofs

Connect Your Android Device

Now on your home directory, create a folder called Android, you can pick up any name you like. Then plug-in the USB cable between your Android device and FreeBSD. Make sure the device is unlocked.

To access your device within FreeBSD, type in this command as a regular user:

simple-mtpfs ~/Android

To learn more about simple-mtpfs, just check out simple-mtpfs’ man pages.

man simple-mtpfs

Disconnect Android Device

You can disconnect your Android device using umount(8) like so:

umount ~/Android

Simple isn’t it? If you’re unable to access your device the first time, try restarting your computer. I hope this helps. Cheers!

Leave a comment