First, pre-installation Preparation 1.1, if you have not installed Ubuntu 14.04 LTS System, please refer to the following article installation
http://blog.csdn.net/lsyz0021/article/details/52187026
Here's what to note: Under Ubuntu Google's official Beta Android Studio Support version is Ubuntu 12.04 LTS, jdk1.8, recommended computer memory 8GB
In fact Ubuntu 14.04 Lts and Ubuntu 16.04 Lts is also possible, here I have installed tests, because the Ubuntu 12.04 LTS version is older, the tutorial here is written in Ubuntu 14.04 Lts.
1.2. If you are a newly installed Ubuntu system, it is best to set the root password before operation
For detailed settings, please refer to: http://blog.csdn.net/lsyz0021/article/details/51580403
sudo passwd root
Then enter the user password and enter the root password two times
1.3. Install Sogou Input Method
Because Android Studio keyboard Input method does not support IBUs, so can only use Fcitx input method, so to install Sogou input method,
Reference article: http://blog.csdn.net/lsyz0021/article/details/52187714
Second, copy the required files to ubuntu2.1, if you do not have the Linux version of Android studio, SDK, jdk please download the required files, I have uploaded to Baidu network disk
:
Android STUDIO-LINUX-2.1.1:HTTPS://PAN.BAIDU.COM/S/1SKPUAPF
Sdk-linux: Link: Https://pan.baidu.com/s/1pLq3dyV
Jdk1.8-linux:https://pan.baidu.com/s/1mh67v5y
2.2, in the home folder (that is,/home/lcw/, LCW is your user name) under the new Android_develop_tools folder
[Java]View PlainCopy
- Mkdir/home/lcw/android_develop_tools
Note: If you do not add sudo here, you can use the shortcut keys CTRL + C (copy), Ctrl_v (paste) to this folder, otherwise you will only be able to copy files using the command line
Copy the downloaded Android-studio, SDK, and JDK to this folder when you are finished creating
Third, install jdk1.83.1, New JVM folder (folder name can not be changed)
[Java]View PlainCopy
- sudo MKDIR/USR/LIB/JVM
3.2. Copy the jdk1.8 to the JVM folder:
[Java]View PlainCopy
- sudo cp/home/lcw/android_develop_tools/jdk-8u92-linux-x64.tar.gz/usr/lib/jvm/
3.3. Go to the JVM folder
[Java]View PlainCopy
- cd/usr/lib/jvm/
3.4, decompression jdk-8u92-linux-x64.tar.gz, after the decompression will have a "jdk1.8.0_92" folder
[Java]View PlainCopy
- sudo tar-zxvf jdk-8u92-linux-x64.tar.gz
3.5. Configure the JDK environment variable and execute the following command after extracting it:
[Java]View PlainCopy
- sudo gedit/etc/profile
Add the following on the last side of the Open document ("jdk1.8.0_92" Here is the folder you unzipped in the previous step)
[Java]View PlainCopy
- Export JAVA_HOME=/USR/LIB/JVM/JDK1. 8.0_92
- Export path= $PATH: $JAVA _home/bin: $JAVA _home/jre/bin
Then press Ctrl+s to save and then close
3.6. Update profile file to make configuration effective:
[Java]View PlainCopy
- Source/etc/profile
3.7 Detect if the configuration is successful, enter:
[Java]View PlainCopy
- Java-version
The following instructions indicate the success of the configuration:
Java Version "1.8.0_92"
Java (TM) SE Runtime Environment (build 1.8.0_92-b14)
Java HotSpot (TM) 64-bit Server VM (build 25.92-b14, Mixed mode)
Iv. installation of sdk4.1, decompression Sdk-linux-2016-08-12.zip
First enter the Android_develop_tools folder
[Java]View PlainCopy
- Cd/home/lcw/android_develop_tools
Then execute the following decompression command, after the extract will have an "SDK" folder
[Java]View PlainCopy
- Unzip sdk-linux-2016-08-12.zip
The decompression time is a bit long, patience and so on
4.2, set the environment variables of the SDK:
[Java]View PlainCopy
- sudo gedit/etc/profile
Append the content to the open document (the SDK in the path is the one you extracted from the previous step, the name cannot be changed)
[Java]View PlainCopy
- Export ANDROID_SDK_HOME=/HOME/LCW/ANDROID_DEVELOP_TOOLS/SDK
- Export path= $PATH: $ANDROID _sdk_home/tools: $ANDROID _sdk_home/platform-tools
After copy, paste, Ctrl+s save, then close
4.3. Update profile file to make configuration effective:
[Java]View PlainCopy
- Source/etc/profile
4.4. Test whether the installation is successful
Enter "Android" in the terminal, can open the Android SDK Manager, the instructions are successful
Perhaps you will encounter the problem:
1. We have already opened the Android SDK Manager in the previous step, make sure that the Tools directory is installed up-to-date, otherwise it will fail at Studio build
Tools directory, select:
Android SDK Tools
Android SDK Platform-tools
Android SDK build-tools (maximum version, preferably download)
2, if you open a new terminal (shortcut key ctrl+alt+t), the input "Android" does not work, restart the computer can be resolved, to this step, we recommend that you restart the computer.
3, Ubantu 16.04 LTS 64-bit system running Android Studio error Unable to run Mksdcard SDK tool, Reason: Lib is missing
Workaround: The installation corresponds to a dependent library
[Java]View PlainCopy
- sudo apt-get install lib32z1 lib32ncurses5 lib32stdc++6
Install Android studio5.1, unzip Android-studio-v2.1.1-linux-2016-08-11.zip
[Java]View PlainCopy
- Unzip Android-studio-v2. 1.1-linux-2016-08-11.zip
When you're done extracting it, run studio.sh in the bin directory of Android-studio to open studio
[Java]View PlainCopy
- cd/home/lcw/android_develop_tools/android-studio/bin/
Open Studio, enter a command
[Java]View PlainCopy
- ./studio.sh
5.2. Set the Quick Launch icon for Android Studio
If you do not set the Quick Start icon, every time you open it, go to .../android-studio/bin/, special trouble.
All of Ubuntu's quick start icons are within the/usr/share/applications/
Enter the following command at the terminal:
[Java]View PlainCopy
- sudo gedit/usr/share/applications/androidstudio.desktop
In the open document, add the following:
[Java]View PlainCopy
- [Desktop Entry]
- Name=android Studio
- Comment=android Studio
- exec=/home/lcw/android_develop_tools/android-studio/bin/studio.sh
- Icon=/home/lcw/android_develop_tools/android-studio/bin/studio.png
- Terminal=false
- Type=application
- Categories=application
When you save, close, you'll see a shortcut to Android Studio in/usr/share/applications, and the copy to desktop double-click icon will work
(Note that each row must be close to the left and the last face of each line cannot have spaces, otherwise it will fail)
When you're done creating it, copy it to the desktop
Explain a few of the above commands:
exec represents the application's location "modified as appropriate"
Icon represents the location of the application icon "modified as appropriate"
A value of terminal false indicates that the command-line window is not started at startup, and a value of TRUE indicates that the command-line window was started with "recommended false"
Categories The content here determines the position of the created starter in the Application menu, the starter created as described above will appear in the application-internet, and so on, if you want to create the starter in the application-Office, The last line above should be written as: Categories=application;office;
CentOS installed Android Studio