Support #680
Updated by Daniel Curtis about 9 years ago
This is a guide on how I set up my development environment for developing Android applications on Arch Linux.
h2. Prepare the Environment
* Make sure the system is up to date:
<pre>
pacman -Syu
</pre>
* Install wget:
<pre>
pacman -S wget
</pre>
* Download and extract the packages for yaourt:
<pre>
cd /tmp
wget https://aur.archlinux.org/cgit/aur.git/snapshot/package-query.tar.gz && wget https://aur.archlinux.org/cgit/aur.git/snapshot/yaourt.tar.gz
tar xzf package-query.tar.gz
tar xzf yaourt.tar.gz
</pre>
#* Install package-query:
<pre>
cd package-query
makepkg -csi
</pre>
#* Install yaourt
<pre>
cd ../yaourt
makepkg -csi
</pre>
* (64-bit Only) Install the multilib repository:
<pre>
vi /etc/pacman.conf
</pre>
#* And make sure the multilib repo is uncommented:
<pre>
[multilib]
Include = /etc/pacman.d/mirrorlist
</pre>
#* Update the pacman repo cache:
<pre>
pacman -Sy
</pre>
h2. Install Android SDK
* Install the Android SDK from the AUR:
<pre>
yaourt android-sdk
</pre>
* Install the Android SDK Platform Tools from the AUR:
<pre>
yaourt android-sdk-platform-tools
</pre>
* Install the Android SDK Build Tools from the AUR:
<pre>
yaourt android-sdk-build-tools
</pre>
* Create an android sdk users group:
<pre>
groupadd sdkusers
</pre>
* Add your user into this group:
gpasswd -a bob sdkusers
* Change folder's group ownership
<pre>
chown -R :sdkusers /opt/android-sdk/
</pre>
Change permissions of the folder so the user in the sdkuser group will be able to write in the sdk folder:
<pre>
chmod -R g+w /opt/android-sdk/
</pre>
* Log out and log back in for the new group to take effect.
h3. Install Android SDK Platform API
* Next install the latest Android SDK Platform API:
<pre>
yaourt android-platform
</pre>
h3. Install Android Tools
* Install android-tools:
<pre>
pacman -S android-tools
</pre>
* Enable USB Debugging on the phone or device:
*# Jelly Bean (4.2) and newer: Go to +Settings -> About Phone+ tap *Build Number* until a popup appears that you have become a developer (about 10 times). Then go to +Settings --> Developer --> USB debugging+ and enable it.
*# Older versions: This is usually done from +Settings -> Applications -> Development -> USB debugging+. Reboot the phone after checking this option to make sure USB debugging is enabled.
* Install android-udev:
<pre>
pacman -S android-udev
</pre>
* Add yourself to the adbusers group:
<pre>
gpasswd -a bob adbusers
</pre>
h2. Install Android Studio IDE
* Install Android Studio from the AUR:
<pre>
yaourt android-studio
</pre>
h2. Resources
* https://wiki.archlinux.org/index.php/Android
* http://developer.android.com/training/basics/firstapp/index.html
* http://developer.android.com/training/index.html