Androidstudio compiling slow This kind of experience is sure a lot of people have!!!

Source: Internet
Author: User
Tags xquery

I was also experienced in the boss standing behind you say look at what you do how about it then you start to compile you just write code and then after a long period of time you silently pick up the water to drink alleviate embarrassment boss has been standing in the back can not help but the sentence is not good? The above, so it's recorded.

JRebel for Android is a plugin for Android studio that can greatly speed up the compilation speed of Android studio, which may not be obvious for small projects, but when the project reaches a certain scale, it is for Android Studio Turtle-like compilation speed has a very big improvement.

JRebel for Android makes it unnecessary to reinstall the new APK after each code change, but after the app is installed, it is delivered to the device or emulator via an incremental package and can be updated when the app is running.

It is said that Jrebel is 8 times times faster than instant run, and details can be found in the official presentation.

1. Installation

You can Plugins Browse Repositories JRebel for Android search and install plugins directly by clicking on the IDE's input.

If for some reason you cannot access Maven's public repositories, you can download them directly from the Jetbrians website and Plugins install the plugins via > Install plugin from disk… .

After you install the plugin, you need to restart Android Studio, after the restart, you need to provide your name and email to get JRebel for Android 21 days free use (JRebel is charged, individual users to $49 per year, but said 21 After the day expires you can re-register, it is said that the official mail is not verified, because I have not used to 21 days, so temporarily unknown, interested you can download the test).

2. Use

Restart Android Studio and you will find the following three buttons appear on the top toolbar:

From left to right, respectively:

    • Run app with JRebel for Android
    • Debug app with JRebel for Android
    • Apply changes with JRebel for Android

In general we only need to run the first time when the installation 第一个按钮 , after the code changes, only need to click 第三个按钮 , your real machine or simulator will soon show the effect of modifying the code.

3. References

[Translate] How to use JRebel for Android

ANDROID Efficient debugging Artifact Jrebel II, Freeline

Freeline is an incremental compilation tool for the Android platform developed by the Ant-Poly Android Team. It leverages cache files to quickly compile and deploy code changes within seconds, effectively reducing the amount of time it takes to recompile and install in daily development.

1. Configuration

Configure Project-level's build.gradle to join the Freeline-gradle dependency:

Buildscript {    repositories {        jcenter ()    }    dependencies {        ' com.antfortune.freeline: gradle:0.8.2 '    }}  

Then, in the Build.gradle of your main module, apply the dependency of the Freeline plugin:

' Com.antfortune.freeline ' Android {    ...}

Finally, execute the following command at the command line to download Freeline python and binary dependencies.

    • Windows[cmd]: Gradlew initfreeline
    • Linux/mac:./gradlew initfreeline

For domestic users, if your download speed is very slow, you can also add parameters, execute Gradlew initfreeline-pmirror, so it will be downloaded from the domestic mirror address, the command is:

    • Windows[cmd]: Gradlew initfreeline-pmirror
    • Linux/mac:./gradlew initfreeline-pmirror

You can also use parameters -PfreelineVersion={your-specific-version} to download specific versions of Freeline dependencies.

If your engineering structure is more complex and you get an error when you first use Freeline to compile, you can add some freeline-provided configuration items to fit your project. Specifically, you can see Freeline DSL References.

2. Use

The quickest way to use Freeline is to install the Android Studio plugin directly.

In Android Studio, through the following path PreferencesPluginsBrowse repositories , search for "freeline" and install.

Directly click on Run Freeline the button, you can enjoy the freeline bring the development efficiency of the promotion (of course, you may need a more time-consuming full-scale compilation process).

The plugin will also prompt you to freeline the latest version, and you can update the freeline with the plugin.

3. References

Freeline Official documents

Androidstudio freeline Realization Project second-level compilation three, other methods

1. Create a gradle.properties file under c:\users\{user name}\.gradle

File contents:

org.gradle.daemon=trueorg.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8org.gradle.parallel=trueorg.gradle.configureondemand=true

:

2. Open Android Studio, select menu item file->settings, tick the Offline work.


Then follow the instructions in the diagram


Finally, save and reopen Android Studio. You gradle should have a great promotion now.


then configure the--profile, generate the profile report, analyze the reason for the slow,


http://liaohuqiu.net/posts/speed-up-your-build/The reason for slow analysis

Androidstudio compiling slow This kind of experience is sure a lot of people have!!!

Related Article

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.