SETUP ANDROID DEVELOPMENT ENVIRONMENT
WHAT WE NEED
1- JDK 6(Java Development Kit) NOTE: you will need to sign in the oracle site for this version of java unfortunately )
2- GNU Make (Optional)
3- Python 2.7
4- Git 1.7
5- Android SDK
6- Some more packages
INSTALLATION
JDK
GIT
Installing the JDK is pretty tricky and stressful every time
First, download the JDK 6, which you can download here. Download the .bin file! (in this case my JDK has been downloaded in the ~/Download folder and my file is named jdk-6u45-linux-x64.bin)
Open up your terminal and type
Ok, if you did everything fine you should now have the JDK installed correctlyCode:$ sudo mkdir /usr/lib/jvm $ cd ~/Downloads/ $ chmod +x jdk-6u45-linux-x64.bin $ ./jdk-6u45-linux-x64.bin $ sudo mv jdk1.6.0_45 /usr/lib/jvm/ $ sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_45/bin/javac 1 $ sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_45/bin/java 1 $ sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk1.6.0_45/bin/jar 1 $ sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_45/bin/javaws 1 $ java -version
PYTHON
This is the easiest one
Code:$ sudo apt-get install git $ y
GNU
Download the 2.7.5 version or newer here
Code:$ cd ~/Downloads/ $ tar -xzvf Python-2.7.5.tgz $ cd Python-2.7.5/ $ ./configure $ make $ sudo make altinstall
OTHER PACKAGES
You don't need this step, do this just if you want the latest version of GNU Make
Download the latest version here
Code:$ cd ~/Downloads/ $ tar -zxvf make-3.82.tar.gz $ cd make-3.82 $ ./configure $ make $ sudo make install
These packages are needed to run many many android commands such as ADB and FASTBOOT (only 64-bit needs this)
Code:$ sudo apt-get install ia32-libs or $sudo apt-get install libc6:i386 libgcc1:i386 gcc-4.6-base:i386 libstdc++5:i386 libstdc++6:i386
This will take about 20 mins especially if you have a slow processor or internet connection so relax and have a coffeeANDROID SDK
SETUP ADB/FASTBOOT
This will be your best friend from now on
Download it here > download for other platforms > download the sdk tools only
Ok now i always create a Development folder where i put all the android development stuff (you can do whatever you think here)
Now you're ready to run the Android SDKCode:$ mkdir ~/development $ cd ~/Downloads $ tar -zxvf android-sdk_r22.0.1-linux.tgz $ mv ~/Downloads/android-sdk-linux ~/development/
FIXING NO PERMISSIONS ERROR
Open up the Android SDK by running this command
At this point the SDK should come up and you will need to download at least all the tools and all the extras files, so select them and install'em.Code:$ cd ~/development/android-sdk-linux/tools $ ./android
When it finishes downloading everything you have to run this commands in another terminal
And you need to add at the end of it your SDK pathsCode:$ sudo gedit .bashrc
If you followed everything now adb and fastboot should work!Code:#Android PATHS export PATH=$PATH:~/development/android-sdk-linux/tools export PATH=$PATH:~/development/android-sdk-linux/platform-tools
to check this you need to close all the terminals opened, reopen one and simply type
You should get a long list of possible commands if so you're done!Code:$ adb $ fastboot
Probably, if you run
right now you'll get a strange output, something like thisCode:$ adb devices or $ fastboot devices
In order to avoid this message we have to create a simple fileCode:???????? No permissionsNow you have to paste this lines in that file and save itCode:$ cd /tmp/ $ touch android.rules $ nano android.rulesNow you have to set the right permissions to this file, just typeCode:SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="0e79", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="0502", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="0b05", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="413c", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="0489", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="091e", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="24e3", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="2116", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="0482", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="17ef", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="1004", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="22b8", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="0409", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="2080", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="0955", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="2257", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="10a9", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="1d4d", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="0471", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="04da", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="05c6", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="1f53", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="04e8", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="04dd", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="0fce", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="0930", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="19d2", MODE="0666Code:$ sudo cp /tmp/android.rules /etc/udev/rules.d/51-android.rules $ sudo chmod 644 /etc/udev/rules.d/51-android.rules $ sudo chown root. /etc/udev/rules.d/51-android.rules $ sudo service udev restart $ sudo killall adb
SUGGESTED PROGRAMS
ECLIPSE
ANDROID STUDIO
In the Android world you don't want to miss the Eclipse IDE which is the most used one! This tool will help you developing/making android apps
You can download it here (download the classic one)
SETUP INFOCode:$ cd ~/Downloads $ tar -zxvf eclipse-SDK-4.2.2-linux-gtk-x86_64.tar.gz $ mv ~/Downloads/eclipse ~/development/
NOTE: If you download the entire ADT bundle provided by google you will get the SDK and Eclipse IDE together
This is the new development IDE made in Google, personally i love it!
You can download it from here
It has a lot of new features that Eclipse doesn't have and it could be useful in some cases
To run it you just need to navigate to its bin folder and typeCode:$ cd ~/Downloads $ tar -zxvf android-studio-bundle-130.687321-linux.tgz $ mv ~/Downloads/android-studio ~/development/
Code:$ ./studio.sh
No comments:
Post a Comment