# [SCRIPT] [Ubuntu] ADB, AAPT, APKTool, Android SDK / NDK, and udev rules auto-installer



## Tahl (Jun 15, 2011)

ANDADB 2.0

This is the sequel to my other installer that adds a few more features automatically. The goal of this program is to automate the installation process as much as possible for those of you that are not as familiar with Linux command-line or those that are just lazy and do not want to go through the process of installing everything again. As per request, I'm moving a copy of this thread into both the CDMA and GSM forums (instead of the Linux thread) so that Galaxy Nexus users can get more use out of it.

*Installation Instructions*

Download the script from Dropbox: http://db.tt/Hf4HMRKC 
or Github using the following command in terminal:
git clone git://gist.github.com/1658401.git gist-1658401​
From terminal type the following commands once the script is downloaded:​


```
<br />
chmod +x andadb.sh<br />
./andadb.sh<br />
```
​
*NOTE: DO NOT USE SUDO TO RUN THE S**CRIPT, IT WILL BREAK THE PATHING OF THE CODE.*​
Once you execute the script you will be presented withthe following menu:​









There are a series of automated options to choose from; depending on the option and internet speed it could take some time to complete. Also, a bug that is caused by the long wait times is that you may have to enter your password multiple times during the download process depending on the speed of your internet connection and the sudo timeout period.

*CURRENT UDEV RULES:*



```
<br />
#Acer<br />
SUBSYSTEM==usb, SYSFS{idVendor}==0502, MODE=0666<br />
#ASUS<br />
SUBSYSTEM==usb, SYSFS{idVendor}==0b05, MODE=0666<br />
#Dell<br />
SUBSYSTEM==usb, SYSFS{idVendor}==413c, MODE=0666<br />
#Foxconn<br />
SUBSYSTEM==usb, SYSFS{idVendor}==0489, MODE=0666<br />
#Garmin-Asus<br />
SUBSYSTEM==usb, SYSFS{idVendor}==091E, MODE=0666<br />
#Google<br />
SUBSYSTEM==usb, SYSFS{idVendor}==18d1, MODE=0666<br />
#HTC<br />
SUBSYSTEM==usb, SYSFS{idVendor}==0bb4, MODE=0666<br />
#Huawei<br />
SUBSYSTEM==usb, SYSFS{idVendor}==12d1, MODE=0666<br />
#K-Touch<br />
SUBSYSTEM==usb, SYSFS{idVendor}==24e3, MODE=0666<br />
#KT Tech<br />
SUBSYSTEM==usb, SYSFS{idVendor}==2116, MODE=0666<br />
#Kyocera<br />
SUBSYSTEM==usb, SYSFS{idVendor}==0482, MODE=0666<br />
#Lenevo<br />
SUBSYSTEM==usb, SYSFS{idVendor}==17EF, MODE=0666<br />
#LG<br />
SUBSYSTEM==usb, SYSFS{idVendor}==1004, MODE=0666<br />
#Motorola<br />
SUBSYSTEM==usb, SYSFS{idVendor}==22b8, MODE=0666<br />
#NEC<br />
SUBSYSTEM==usb, SYSFS{idVendor}==0409, MODE=0666<br />
#Nook<br />
SUBSYSTEM==usb, SYSFS{idVendor}==2080, MODE=0666<br />
#Nvidia<br />
SUBSYSTEM==usb, SYSFS{idVendor}==0955, MODE=0666<br />
#OTGV<br />
SUBSYSTEM==usb, SYSFS{idVendor}==2257, MODE=0666<br />
#Pantech<br />
SUBSYSTEM==usb, SYSFS{idVendor}==10A9, MODE=0666<br />
#Philips<br />
SUBSYSTEM==usb, SYSFS{idVendor}==0471, MODE=0666<br />
#PMC-Sierra<br />
SUBSYSTEM==usb, SYSFS{idVendor}==04da, MODE=0666<br />
#Qualcomm<br />
SUBSYSTEM==usb, SYSFS{idVendor}==05c6, MODE=0666<br />
#SK Telesys<br />
SUBSYSTEM==usb, SYSFS{idVendor}==1f53, MODE=0666<br />
#Samsung<br />
SUBSYSTEM==usb, SYSFS{idVendor}==04e8, MODE=0666<br />
#Sharp<br />
SUBSYSTEM==usb, SYSFS{idVendor}==04dd, MODE=0666<br />
#Sony Ericsson<br />
SUBSYSTEM==usb, SYSFS{idVendor}==0fce, MODE=0666<br />
#Toshiba<br />
SUBSYSTEM==usb, SYSFS{idVendor}==0930, MODE=0666<br />
#ZTE<br />
SUBSYSTEM==usb, SYSFS{idVendor}==19D2, MODE=0666<br />
```
*MAJOR SYSTEM CHANGES*

Android ADB will function with the command "adb" from anywhere
Android Asset Packaging Tool (AAPT) will function with the command "aapt" from anywhere
APKTool will function with the command "apktool" from anywhere
~/bin set to be in the users path so anything can be accessed that is placed in that folder (/user/NAME/bin)
Android SDK installed to /usr/local/android-sdk
Android NDK installed to /usr/loca/android-ndk
Eclipse installed
Python installed
OpenJDK installed, both java and javac are available for compiling and running java applications
repo (http://code.google.com/p/git-repo/) installed to /usr/local/bin/repo, accessible anywhere
ia32-libs installed for 64-bit systems


----------



## freebordjunky (Jan 13, 2012)

i alwas get errors when running the script... cant find sudo cant find this and cant find that.... what did i miss?


----------



## Tahl (Jun 15, 2011)

freebordjunky said:


> i alwas get errors when running the script... cant find sudo cant find this and cant find that.... what did i miss?


What operating system are you running this on? You should have Sudo starting out with *most* major Linux distributions.


----------



## Racing19969 (Dec 1, 2011)

Nice package. Only problem is it installs older version of Eclipse and you need newest version to work on the new android platforms.


----------



## Tahl (Jun 15, 2011)

It should install the version that is in the repository. Do you know off hand what the name of newest Eclipse is in the Ubuntu repository? I can make that change pretty easily.


----------

