Project

General

Profile

Support #680

Updated by Daniel Curtis over 8 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: wget: 
 <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> 

 * (64-bit Only) Install libtinfo: the multilib repository: 
 <pre> 
 yaourt libtinfo 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: 
 <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 Jelly Bean (4.2) and newer*: newer: Go to +Settings -> About Phone+ tap _Build Number_ *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*: 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

Back