The Linux environment I am using is ubuntu-12.10-desktop-i386. The software to be prepared before installation:
1.JDK (jdk-7u75-linux-i586.tar.gz) http://www.oracle.com/technetwork/java/javase/downloads/ Jdk7-downloads-1880260.html
2.ADT (adt-bundle-linux-x86-20140321.zip) Link: http://pan.baidu.com/s/1i3qvJ0p Password: h7k4
(I'm under an Android ADT Integration pack, which includes Eclipse and ANDROID-SDK, so it's easier if you download the latest Eclipse and ANDROID-SDK files separately, you'll need FQ, and the SDK and ADT in the update Need FQ, that would be very troublesome)
Create a Hoo user under Linux (this user name can be casually, as long as it is easy to remember and identify), to manage the Android development environment, download the prepared software to the/home/hoo directory, and then start to build the environment.
First, install the JDK(Eclipse and androidsdk all depend on the JDK environment, make sure the working directory is/home/hoo)
1. Because the JDK i downloaded is a tar.gz file, it can be extracted directly.
Enter TAR-XVF jdk-7u75-linux-i586.tar.gz in the terminal command and then enter to get the Jdk1.7.0_75 folder.
(If the JDK is in bin format, you need to add executable permissions first chmod u+x Jdk-7u75-linux-i586.bin and then use./jdk-7u75-linux-i586.bin)
2. Configure environment variables, the profile file needs to be modified under Linux, using sudo gedit ~/.profile
Add export java_home=/home/hoo/jdk1.7.0_75 to the
Export path= $JAVA _home/bin: $PATH:/home/hoo/adt-bundle-linux-x86-20140321/sdk/tools (later an DROID-SDK need to configure the path, so in order to make it easier to configure together)
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Save.
After the modification is completed, the environment variable does not take effect immediately, requires a restart or use of source ~/.profile to make it effective, and finally uses java-version to verify that the JDK is installed successfully, and if OPENJDK is displayed, your default version is not set, then you can follow the H Ttp://blog.sina.com.cn/s/blog_437ff56b0100tfi5.html The method here continues to be set.
II. installation of ADT
1. Decompress, TAR-XVF Adt-bundle-linux-x86-20140321.zip get Eclipse and SDK two folders.
2. Configure the SDK, click Run Eclipse, Show Java-adt, and then click Windows->preferences->android, there will be the SDK location and find your SDK folder here, my It's/home/hoo/adt-bundle-linux-x86-20140321/sdk, then OK.
3. Configure the AVD, open the AVD Manager from Windows->android VIrtual Device Manager, click New, create a new AVD, fill it out yourself, and then click OK. (where device is set screen, resolution, target is set version)
Iii. Creating and running the project
By file->new->android Application project then enter the demo (project name, feel Free), Next,finish, then click Run Debug (or press F11) to be in the simulator you configured Run out.
Four, mobile phone installation apk
1. First install ADB under Linux
Connect the phone, turn on the phone debug mode, if running under the virtual machine, also click on the virtual machine--Mobile device, then select your phone, click Connect. Then enter LSUSB in the terminal to view the device record
Bus 001 Device 002:id 18d1:4e26 Google Inc.
Bus 002 Device 002:id 0e0f:0003 VMware, Inc. Virtual Mouse
Bus 002 Device 003:id 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 001 Device 001:id 1d6b:0002 Linux Foundation 2.0 root Hub
Bus 002 Device 001:id 1d6b:0001 Linux Foundation 1.1 root Hub
I'm here for Bus 001 Device 002:id 18d1:4e26 Google Inc.
Then create a profile under/etc/udev/rules.d/. sudo gedit/etc/udev/rules.d/50-android.rules file, add the following information
subsystem== "USB", attrs{idvendor}== "18d1", attrs{idproduct}= "4e26", mode= "0666" Save,
Set permissions for configuration files sudo chmod a+rx/etc/udev/rules.d/50-android.rules
Restart, Sudo/etc/init.d/udev Restart
Then declare the path of ADB in/ETC/BASH.BASHRC: Export path=/home/hoo/adt-bundle-linux-x86-20140321/sdk/platform-tools: $PATH Then SOURCE/ETC/BASH.BASHRC restart adb adb kill-server adb start-server
Then use the ADB Devices command to find your device, and you'll be able to see your device information.
Finally, open the terminal, go to your apk folder, enter the adb install xxx.apk (XXX is your apk filename) can be installed directly to your phone, if you want to uninstall the words input adb uinstall com.xxx.xxx (Uninstall to specify the package name )
It's all over!
Build Android development environment under Linux