You are an amazing android developer and love to develop awesome apps but your android studio is not so fast, you might have experienced sluggishness or slow responsive of the android studio. Today I will give you some tricks to make it faster.
First of all, I will recommend you to increase your RAM memory of your computer, because Android studio runs best on 8GB of RAM or higher. It tends to run pretty better on 4GB of RAM but when you open other softwares like firefox, chrome or anything with the android studio, one of the software or both of them at a time will give you “Not responding!” error message, which is quite irritating!
So let’s start!
1. Enable Offline work
In android studio, go to File(located on the top left corner) -> Settings or you can simply use this shortcut Ctrl+alt+S
- New window will be popped up on screen which will look something like this
- Next, click on Build, Execution, Deployment section which is located in the side menu.
- Under that section, click on the Gradle section, and check ✅the Offline work under ‘Global gradle settings’ and hit the OK button like this
- Now again go to file–>settings and click the Compiler tab under Build, Execution, Deployment section and type –offline in the Command-line option box and then click on OK button like this
- Now, restart your android studio and feel the difference.
2. Improving Gradle
- Open Android studio, click on the gradle.properties section in the left side menu under Gradle Scripts section and add these two lines below:
- Now Sync your project which will be prompted like this:
3. Use Instant Run
4. Testing your app? Real android device or emulator
- You must enable USB debugging option on your android smartphone.
- Install the appropriate OEM USB driver on your computer.
- Go to settings on your smartphone, scroll down to bottom you will find Developer options if it’s not there continue reading next step.
- Scroll down to bottom and click on About phone.
- Now again scroll down, you will find Build number.
- Click the Build number section 6-7 times until it says “You are now a developer”.
- Once you have done with the above steps come back and you will see new option i.e. Developer Option.
- Click on Developer option and scroll down until you see USB Debugging click on that and enable it.
- Now you have successfully enabled USB Debugging on your phone.
- Go and find yourself a USB cable and connect your phone to the computer.
How to download the OEM driver?
- Go to the OEM USB driver website and install the appropriate driver that you want on your computer.(The link that I have provided above also contains the information on how to install the driver on your computer)
- Once you downloaded your appropriate file unzip it.
- Now open the SDK Manager (To open SDK Manager from android studio, click on Tools > Android > SDK Manager or click SDK Manager in the toolbar)
- Download the Google USB Driver from the SDK Manager and install it.
- Now connect your phone to computer(USB Debugging should be enabled).
- Move on to Device Manager on your computer and select Portable Devices –> Your Device Name.
- Now right click on Your Device name and click on Update Driver software and select “Browse my computer for driver software”.
- Now click on Browse button and point it to ” C:\Users\YourUserName\AppData\Local\Android\sdk\extras\google\usb_driver” and check the Include subfolders checkbox, hit next and finish.
- Now open android studio and to connect your phone to computer with USB debugging enabled and when you are ready click on Run button and select your device and click OK button like this
Now you are ready to test your awesome app on your real android device.
Note: If your smartphone OEM USB Driver is not available in the list of OEM Drivers(e.g, XOLO smartphone USB Driver is missing on that list) you will need to install Android USB Driver if you are wondering on how to download and install it click here