ubuntu12.04 Installing Android Studio notes

Source: Internet
Author: User

Ubuntu install Android StudioDescription

Installation Tutorial Reference Stormzhang's Blog

All the software here (has been backed up to its own pan)

Note: This note is completed under Gitbook and thrown to the OSC to see how it supports markdown? (The result is gitbook too perfect, OSC Markdown also need refueling)

Installing the SDK
  1. Extract sdk/android-sdk_r24.0.2-linux.tgz to /home/cyper/android-sdk-linux (set to $android_home), this step will generate the tools directory, which has ANDROID command, this file size is 140.1M

  2. Unzip platforms/android-19.zip to $android_home/platforms, here I downloaded 19 (4.4.2), size 63.9M,

  3. Unzip platform-tools/platform-tools_r21-linux.zip to $android_home/platform-tools, which has the ADB command, this file size is 1.7M

  4. Unzip system-images/android-19.zip to $android_home/system-images, note this is 818.2M file (down the time and the file in step 2 has the same name but different size!) )

  5. Go to the $ANDROID _home/tools, execute the ./android command, and you can download additional packages. How to speed up? Modify the /etc/hosts following code

    203.208.46.146 dl.google.com203.208.46.146 dl-ssl.google.com

    Then tick the tools > Options > Force HTTPS source to be fetched using HTTP so that the SDK Manager can download at full speed without FQ.

  6. Why the 5th step, because the download page happened to not provide Linux under Build-tools installation package, so I installed in the fifth step Build-tools, and package it back to /home/cyper/Downloads/mobile-tools/android/build-tools/android-build-tools-r21.1.2-linux64.tar.gz my Baidu disk.

  7. Open/etc/profile to set environment variables so that you can use the Android and ADB commands.

    #set jdkexport ANDROID_HOME=/home/cyper/android-sdk-linuxexport PATH=$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATHexport JAVA_HOME=/opt/jdk/jdk1.7.0_45export JRE_HOME=/opt/jdk/jdk1.7.0_45/jreexport PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATHexport CLASSPATH=$CLASSPATH:.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
  8. Command as follows

    sudo update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk1.7.0_45/bin/javac 1sudo update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.7.0_45/bin/java 1sudo update-alternatives --install /usr/bin/javaws javaws /opt/jdk/jdk1.7.0_45/bin/javaws 1sudo update-alternatives --config java

    The explanation of the command is here., the above 7, 82 step is to hope that Android Studio can find my JDK and SDK home during the installation, the result is disappointing.

  9. install GRADLE, just unzip it to the place below, then set up $gradle_home, add bin to path (this step temporarily seems redundant.)

Installing Gradle

In the Android Studio series tutorial One – download and install the new project after the success will download Gradle, it seems that the process does not flip the wall is also available to download, but the visit is particularly slow, it is recommended to flip the wall to download. So where does the downloaded gradle go?

Mac上会默认下载到 **/Users/<用户名>/.gradle/wrapper/dists** 目录Win平台会默认下载到 C:\Documents and Settings<用户名>.gradle\wrapper\dists 目录

You will see this directory has a Gradle-x.xx-all folder, if the download is too slow, but do not want to flip the wall, you can manually download the corresponding version of the Gradle official website, and then download the. zip file (can also be unzipped) Copy it to the Gradle-x.xx-all folder above, but it is recommended to have it downloaded directly.

Important: the above installation Gradle copied from Stormzhang's blog, looks at 1.1 Preview2 does not work, only makes the reference

Install Android Studio

The following are the procedures for installing studio.

  1. Install data Studio to extract the/opt/i directory and create a shortcut in the Gnome panel.

  2. The first recommendation is to use the./studio.sh to start studio so that studio kills studio when it's suspended.

  3. Specify JDK as/opt/jdk/jdk1.7.0_45,studio it's silly not to know where my JDK is loaded.

  4. Tip This Linux system supports emulator acceleration via KVM.

    Http://developer.android.com/tools/devices/emulator.html#vm-linux, temporarily ignoring this information.

  5. Start downloading a file, strangely, I canceled it directly.

    Connecting to ' http://dl.google.com/android/android-sdk_r22.6.2-linux.tgz '.

  6. Open Studio and prompt me to install

    • Build-tools R21.1.1 (Halo, I previously installed R21.1.2)
    • SDK Platform Android 5.0.1, API, Revision 2
    • Google APIs, Android API, Revision 1
    • Google AIPs Intel x86 Atom sytem Image API Revision 3
    • Sources for Android SDK, API, Revision 1
    • Android support Repository, revision 11
    • Google Repository, Revision 15
  7. New project, prompted to download Gradle. (Next, although the previous download is good, and set the Gradle_home, does not work!) This step in the FQ state or really slow. Bored in so search to a fix gradle compile slow problem, here are tricks, but I this is download slow not compile slow, finally really impatient, directly cancel the download, rm -rf ~/.gradle and then restart Studio, unexpectedly no longer prompted to download Gradle. So 1.1 Preview2 no longer seems to need to download Gradle himself.

  8. Run the simulator error when installed, prompting to install KVM, refer to [here:] (

    Http://askubuntu.com/questions/552064/how-can-kvm-be-located-by-android-studio-on-ubuntu-14-04-lts). The final resolution step is super simple: Enter KVM-OK hint to install Cpu-checker,so sudo apt-get install cpu-checker ,

    Then enter the KVM-OK prompt sudo modprobe kvm_intel to execute, and prompt to add sudo

    [email protected]:~$ sudo kvm-okINFO: /dev/kvm existsKVM acceleration can be used[email protected]:~$

    Get.

9. No picture, no truth.

ubuntu12.04 Installing Android Studio notes

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.