Ubuntu 16.04 Android Studio Development environment Setup

Source: Internet
Author: User

Installation steps:

1. Installing the Java Developer Kit

2. Install Android Developer Kit

3. Install Android Studio

4. Real-Machine Commissioning

For the first time with Linux, the command basically does not, the following commands are in the search for the various data inside copy

Java Developer Kit Installation

1. Download jdk-8u144-linux-x64.tar.gz tip: In the Download dialog box, select: Save file so that it exists directly in the/home/user name/downloads folder.

2. Graphical interface operation: Enter the /home/user name/downloads folder through the taskbar on the left, and then via the right-click menu command: Extract here to release the file to the current location

3. The graphical interface is unable to create a folder (theory is not a privilege or anything) create a Java folder in the/usr directory by command: Press the win key, enter the CMD Search command program in the Pop-up dialog box, and then open it

Execute command: (three contents of the step I have installed in the Java directory): sudo mkdir/usr/java, execute this command requires a power-on password

4. Move the JDK files extracted from step 2 to the Java folder and execute them by command

Execute command: Sodu MV /home/user name/downloads/jdk-8u144-linux-x64/usr/java

5. Configure variables to add configuration directly at the end of the/etc/profile file

Execute command: sudo gedit/etc/profile This command is to open the profile file, and then paste the following into the end of the file (java_home changes are required to replace Ha, others unchanged):

Export java_home=/usr/java/jdk1.8.0_144
Export path= $JAVA _home/bin: $JAVA _home/jre/bin: $PATH
Export classpath=:.: $JAVA _home/lib: $JAVA _home/jre/lib

6. Executive Source/etc/profile

7. Verify that the installation was successful (my verification was successful)

Execution: Java-version

Execution: Javac-version

Android Developer Kit Installation

1. Download sdk:android-sdk_r24.4.1-linux.tgz in the Android Chinese community

Unzip and move to the Java directory, with the JDK operation mode

2. Launch the SDK manager from the command:

Execute command:/usr/java/android-sdk-linux/tools/android

Tip: If execution fails, the failure message is as follows:

./android:1:./android:java:not found
./android:1:./android:java:not found
./android:110:exec:java:not found

Explain the Java environment problem, just clearly configured, I experimented with the following: in the new command line tool execution java-version will fail, at present do not know why, and so will restart after the test

Execute the Source/etc/profile again and then execute the above command again to open the SDK manager.

3.SDK Manager program opened, he actually did not have a menu bar, unable to configure the agent through the graphical interface, and then checked the next, finally did not find the answer, and the attitude of trying to try to click: Install button, a: Direct installation success, Greater than or equal to 4.4. Version 2 I downloaded it.

Android Studio Installation

1. Or go directly to the Android Chinese community directly to download the latest Android Studio package available

2. Unzip the same way and then move to the Java directory

3. Execution command: sudo/usr/java/android-studio/bin/studio.sh

4. After executing the command, an installation operation is performed and there is an error message in the middle: unable to run Mksdcard SDK tool.

Execute command:sudo apt-get install lib32z1 lib32ncurses5 lib32stdc++6

5. Execute the 3-step command to open Android Studio and create a new project

6. I created a workspace in the Java directory, the project I saved here

7. The new project has been in: Building ' Myfirstapp ' Gradle Project Info interface, lasted 10 minutes + +

8. As the internet says, he is downloading Gradle, direct configuration agent: mirrors.opencas.cn:80,

9. New project, the direct success, but the TM encountered a problem, about Gradle

Android Studio tip: Error:unable to tunnel through proxy. Proxyreturns "http/1.1 Bad Request"

Then I found in the command line panel: Downloading Https://downloads.gradle.org/distributions/gradle-3.3-all.zip (this link is displayed in the Command line window)

Always download not down, then I copy this link directly to the browser ... Straight down, then I also unzip him into the Java directory, and then point to the local Gradle package in the Setting--gradle settings, and then start again successfully, the project was compiled successfully

Tip: If Android Studio is configured with code, Gradle Sync may fail and the agent can be removed.

Real-Machine debugging

Add a configuration file on it.

1. Create or open a file by command: 51-android.rules
Execute command: sudo gedit/etc/udev/rules.d/51-android.rules
Then copy the following in the text editor:
subsystem== "USB" env{devtype}== "Usb_device", mode= "0666"
Save the file to

2. Execution command:/USR/JAVA/ANDROID-SDK-LINUX/PLATFORM-TOOLS/ADB devices
And then we found the device.

3. Start Android Studio again, try to debug, debug successfully, breakpoint also hit

At this point, Ubuntu 16.04 lts installed Android Studio is finished, also equivalent to a note, in case of the next deployment of the environment, North view

Ubuntu 16.04 Android Studio Development environment Setup

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.