Setting up Arch Linux for Android development

Install Android Studio

You can install the android-studio AUR package.

$ wget https://aur.archlinux.org/cgit/aur.git/snapshot/android-studio.tar.gz
$ tar -xzf android-studio.tar.gz
$ cd android-studio
$ make-pkg -sri

Add udev rule

In order for adb to work, one needs to create the appropriate permissions by adding special udev rules.

Create the file /etc/udev/rules/51-android.rules with the following content:

SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0666", GROUP="adbuser"
SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", ATTR{idProduct}=="6765", SYMLINK+="android_adb"
SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", ATTR{idProduct}=="6765", SYMLINK+="android_fastboot"

You need to create the adbuser group and add yourself to it.

Here I used the codes 05c6 for Qualcomm and 6765 for OnePlus One. These codes can be found on the internet. One can also find the codes using lsusb:

$ lsusb
# ...
Bus 001 Device 007: ID 05c6:6765 Qualcomm, Inc.
# ...

Once the rules created you need to reload udev rules. The documentation I used used udevadm but it didn’t work for me. Instead I did the following:

$ sudo systemctl restart systemd-udevd.service

Notes on OpenJDK

Android Studio warns about being slow or unstable with OpenJDK. One might want to install Oracle’s JDK instead. I’m giving a try to OpenJDK for now.

Next post