Android development Environment under Ubuntu (iv) Core installation Androidstudio, SDK, JDK (by star Wuge)

Source: Internet
Author: User
Tags administrator password android sdk manager

Reprint please mark original address: http://blog.csdn.net/lsyz0021/article/details/52215996


All software is tested under Ubuntu 14.04 LTS

Ubuntu built Android Development Environment (i) Install Ubuntu system
Android development Environment under Ubuntu (ii) Set the root administrator password for Ubuntu
Ubuntu under Android development Environment (iii) Ubuntu installation Sogou Input Method

Android development Environment under Ubuntu (iv) Core installation Androidstudio, SDK, JDK


First , pre-installation preparation1.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

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, installation jdk1.83.1. Create a new JVM folder (the name of the folder cannot be changed)

sudo MKDIR/USR/LIB/JVM

3.2. Copy the jdk1.8 to the JVM folder:

sudo cp/home/lcw/android_develop_tools/jdk-8u92-linux-x64.tar.gz/usr/lib/jvm/

3.3. Go to the JVM folder

cd/usr/lib/jvm/

3.4, decompression jdk-8u92-linux-x64.tar.gz, after the decompression will have a "jdk1.8.0_92" folder

sudo tar-zxvf jdk-8u92-linux-x64.tar.gz

3.5. Configure the JDK environment variable and execute the following command after extracting it:

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)

Export Java_home=/usr/lib/jvm/jdk1.8.0_92export 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:

Source/etc/profile

3.7 Detect if the configuration is successful, enter:

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 the SDK4.1, decompression sdk-linux-2016-08-12.zip

First enter the Android_develop_tools folder

Cd/home/lcw/android_develop_tools
Then execute the following decompression command, after the extract will have an "SDK" folder

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:

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)

Export Android_sdk_home=/home/lcw/android_develop_tools/sdkexport 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:

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

sudo apt-get install lib32z1 lib32ncurses5  lib32stdc++6

v. Installation of Android Studio5.1, decompression android-studio-v2.1.1-linux-2016-08-11.zip

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

cd/home/lcw/android_develop_tools/android-studio/bin/
Open Studio, enter a command

./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:

sudo gedit/usr/share/applications/androidstudio.desktop

In the open document, add the following:
[Desktop Entry] Name=android studiocomment=android studioexec=/home/lcw/android_develop_tools/android-studio/bin/studio.shicon=/ home/lcw/android_develop_tools/android-studio/bin/studio.pngterminal=falsetype=applicationcategories= 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;




Android development Environment under Ubuntu (iv) Core installation Androidstudio, SDK, JDK (by star Wuge)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.