How to make Android Studio Lightning Fast?
Published by Ankush Kapoor — Android Developer at Paytm
It's pretty annoying waiting for the build to complete. Fortunately, there are some ways which will help you to reduce the build time. Just follow the article and the difference will be huge.
1. Edit Custom VM Options
- Goto Help -> Edit Custom VM Options
- If studio.vmoptions doesn’t exist you will get a popup asking to create the file. So click on create.
- Copy-paste the below code snippet
Understanding studio.vmoptions
“Xms1G” — This sets the initial size of the heap to 1 GB.
“Xmx3096m” — This is the RAM allocated to Android Studio.
The remaining fields can be used as such. For more detailed understanding visit https://developer.android.com/studio/intro/studio-config.html
Note: My system’s RAM is 8GB so I have configured studio.vmoptions according to my system’s RAM. You can increase or decrease the memory size accoring to your system’s RAM.
2. Disable unused Plugins
Plugins increase the load time of Android Studio. So the below mentioned unused plugins can be disabled.
- Goto Android Studio -> Preferences (on mac)
File -> Settings (on Windows) - Search for Plugins (Open installed plugins tab)
- Uncheck these plugins
Android Games
App Links Assistant
Firebase App Indexing
Firebase Services
Firebase Testing
Google Cloud Tools Core
Google Cloud Tools For Android Studio
Google Login
Subversion
Other unused plugins can also be unselected.
Don’t uncheck if you are using them.
3. Enable Gradle Offline Work
For Windows
- Go to File -> Settings.
And open the'Build,Execution,Deployment'
. Then open the Gradle - Uncheck -> Offline work on the right. Click the OK button. Then Rebuild the Project.
For Mac OS:-
Goto Android Studio -> Preferences, and the rest is the same.
Don’t forget to hit the clap button :)