Android Development on Arch

Android SDK Installation

(If you are running Arch64, you have to enable the multilib repo, to be able to to install the required dependencies using pacman.)

To install the android-sdk, simply install it from the AUR android-sdk. When using Eclipse as an IDE. you need to install the ADT plugin and related packages. If you get a message about unresolvable dependencies, install Java manually and try again.

Android Debug Bridge (ADB) - Connecting to a real device

To get ADB to connect to a real device or phone under Arch, you must install the udev rules to connect the device to the proper /dev/ entries. This can be done manually, or you can use the AUR package android-udev to use a common list of vendor IDs.

Each Android device has a USB vendor/product ID. An example for HTC Evo is:

vendor id: 0bb4
product id: 0c8d

Figure Out Your Device Ids

Plug in your device and execute:

# lsusb

It should come up something like this:

Bus 002 Device 006: ID 0bb4:0c8d High Tech Computer Corp.

Adding udev Rules

Use the following udev rules as a template, and replace [VENDOR ID] and [PRODUCT ID] with yours. Copy these rules into Template:Filename:

Automatic installation is done via the Android SDK and device manager, which is accessible by invoking (assuming that the $PATH variable contains the path to the Android SDK Template:Filename directory):

If the automatic installation errors out, then you must either run the android tool with heightened privileges or have your user account or a group take control of the directory. As either root or by using sudo, type:

Tethering

Tricks

During Debugging "Source not found"

Most probably the debugger wants to step into the Java code. As the source code of Android does not come with the Android SDK, this leads to an error. The best solution is to use step filters to not jump into the Java source code. Step filters are not activated by default. To activate them:

Android SDK on Arch 64

When using the Android SDK and the Eclipse plugin on a 64 bit system, and the 'emulator' always crashes with a segfaul, do the following:
Provide a localtime file in /usr/share/zoneinfo/localtime e.g.: