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
* Edit the pacman config file:
<pre>
vi /etc/pacman.conf
</pre>
#* And uncomment the multilib definition:
<pre>
[multilib]
Include = /etc/pacman.d/mirrorlist
</pre>
* Make sure the system is up to date:
<pre>
pacman -Syu
</pre>
* Install a few dependencies:
<pre>
pacman -S gcc git gnupg flex bison gperf sdl wxgtk squashfs-tools curl ncurses zlib schedtool perl-switch zip unzip libxslt python2-virtualenv bc wget gcc-multilib lib32-zlib lib32-ncurses lib32-readline
</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>
* Install libtinfo:
<pre>
yaourt libtinfo
</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:
<pre>
gpasswd -a bob sdkusers
</pre>
* 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
* http://developer.android.com/training/basics/firstapp/creating-project.html