With the growing sophistication of Android studio development tools, more and more programmers are choosing this IDE tool for development, but Android studio sometimes gets stuck in the process of using it. When it comes to the project, it is most distressing to encounter such problems, but there is no way to improve such problems. Small series on the internet for some optimization of the Android Studio startup, compile and run the speed of the method, share to everyone, quickly learn it.
Android Studio Start Error Resolution
Before using Android Studio, we start it first, and in the process of booting, there are often errors. Below, we first solve this problem:
1. Enter the bin directory under the Android Studio directory that you just installed. Locate the Idea.properties file and open it with a text editor.
2. Add a line at the end of the idea.properties file: Disable.android.first.run=true, then save the file.
3. After shutting down Android Studio, reboot to enter the interface.
Android Studio Start Speed optimization
1. Open Gradle Individual daemon
When Android studio encounters an error, it often causes Android studio to hang up, and in order to prevent the program from exiting, another thread is turned on to protect the Android studio process, specifically. Under C:\Users\.gradle This directory, create the Gradle.properties configuration file and copy the following configuration for optimization.
# project-wide Gradle settings.
Org.gradle.daemon=true
org.gradle.jvmargs=-xmx2048m-xx:maxpermsize=512m
-xx:+heapdumponoutofmemoryerror-dfile.encoding=utf-8
Org.gradle.parallel=true
Org.gradle.configureondemand=true
The main purpose of configuring these profiles is to increase the size of the Java virtual machine running by Gradle, allowing Gradle to use a standalone process at compile time, allowing Gradle to run well.
2. Enlarge memory
64-bit: \studio64.exe.vmoptions or studio.exe.vmoptions
32-bit: \studio.exe.vmoptions or studio.exe.vmoptions
Edit this file to set the memory size in the first two lines, similar to the configuration in Eclipse.ini. The configuration is as follows:
-xms256m
-xmx1024m
3. Optimize the VM size at compile time
Select File->setting->compile to add the following parameters:
-xmx1024m
-xx:maxpermsize=128m
-xx:+heapdumponoutofmemoryerror
-dfile.encoding=utf-8
The specific parameter size depends on the computer configuration.
Through these optimization operations, the actual test, the compilation speed is greatly improved, than the larger items from the previous 5-8 minutes can be reduced to 1-2 minutes.
If you're developing an Android project that's relatively large, and Android studio often has a problem with it, you might want to try the optimizations above. Of course, if you have a better method of optimization, also welcome to add to share.
Optimize the speed of studio