Maximizing Android Studio on Mac Silicon: Performance and Productivity Tips

Android Studio is the official integrated development environment (IDE) for Android app development, providing powerful tools and features for developers. In this guide, we’ll walk you through installing and uninstalling Android Studio, setting up emulators and SDKs, configuring environment variables, and sharing performance tips for faster execution in test automation.
Table of Contents:
- Installing Android Studio
- Setting Up Android Emulators
- Installing Android SDKs
- Configuring Environment Variables
- Uninstalling Android Studio
- Performance Improvements
- Conclusion
Installing Android Studio
To install Android Studio on macOS, follow these steps:
a. Visit the official Android Studio download page (https://developer.android.com/studio).
b. Download the latest version of Android Studio for macOS.
c. Open the downloaded DMG file and drag the Android Studio app to the Applications folder.
d. Launch Android Studio from the Applications folder.
e. Follow the setup wizard to complete the installation.
Setting Up Emulators and SDKs
After installing Android Studio, you need to set up Android Virtual Devices (AVDs) and SDKs for testing:
a. Open Android Studio and click on “Configure” > “SDK Manager.”
b. Install the required SDK components.
c. Click on “Configure” > “AVD Manager.”
d. Create and configure the required virtual devices for testing.
Configuring Environment Variables
To configure environment variables, add the following lines to your ~/.zshrc
or ~/.bash_profile
file:
export ANDROID_HOME=$HOME/Library/Android/sdk
exportPATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
exportANDROID_AVD_HOME=$HOME/.android/avd
Save the file and restart your terminal or run source ~/.zshrc
or source ~/.bash_profile
to apply the changes.
Performance Improvements
To improve the performance of Android Studio and your emulators, follow these tips:
Improve Android Studio performance:
- Goto — Android Studio → Settings → Appearance & Behavior → System Settings → Memory Settings → Increase Heap Size (2048 or greater)
- Goto — Android Studio → Settings → Editor → File Types → Ignored Files → add thumb.db
- Goto — Android Studio → Settings → Plugins → Remove unimportant plugins (*do not delete system plugins)
Improve emulator performance:
Emulator — advanced settings
- Disable device frame
- Set camera — none
- Emulated performance — quick boot
Edit emulator configuration:
Refer to the below config where RAM and heap size are increased and a few options are turned off:
- Navigate to
~/.android/avd
and open theconfig.ini
file for the desired emulator. - Modify the following lines or add them if they don’t exist
hw.audioInput = no
hw.camera.back = none
hw.camera.front = none
hw.ramSize = 2048
hw.sensors.orientation = no
hw.sensors.proximity = no
showDeviceFrame = no
vm.heapSize = 1024
Save the changes and restart the emulator for the changes to take effect.
Uninstalling Android Studio
If you need to uninstall Android Studio, follow these steps:
Open Terminal and run the following commands to remove Android Studio and related files:
sudo rm -rf "/Applications/Android Studio.app"
sudo rm -rf ~/Library/Preferences/AndroidStudio*
sudo rm -rf ~/Library/Application\ Support/AndroidStudio*
sudo rm -rf ~/Library/Logs/AndroidStudio*
sudo rm -rf ~/Library/Caches/AndroidStudio*
sudo rm -rf ~/Library/Preferences/Google/AndroidStudio*
sudo rm -rf ~/Library/Preferences/com.google.android.*
sudo rm -rf ~/Library/Preferences/com.android.*
sudo rm -rf ~/Library/Application\ Support/AndroidStudio*
sudo rm -rf ~/Library/Application\ Support/Google/AndroidStudio*
sudo rm -rf ~/Library/Logs/Google/AndroidStudio*
sudo rm -rf ~/.AndroidStudio* sudo rm -rf ~/Library/Android
sudo rm -rf ~/.android
sudo rm -rf ~/Library/Android*
sudo rm -rf ~/.android/avd
Remove temporary files
Save the file and restart your terminal or run `source ~/.zshrc` or`source ~/.bash_profile` to apply the changes.
Conclusion
In this guide, we've covered how to install and uninstall Android Studio, set up emulators and SDKs, configure environment variables, and shared performance tips for faster execution in test automation. By following these steps, you'll be better prepared to create and manage your Android test automation environment on macOS.