5

I have limited SSD on my Mac.

I have an external SSD.

I would like to store multiple virtual devices, far beyond the capacity of the Mac internal storage.

How to configure location of AVD?

Attempt 1

I tried using: https://stackoverflow.com/a/30614524/775359

ln -s /Volumes/1TB/.android .android

The files are stored on SSD but when I try to launch, it keep bouncing in the dock 😢

enter image description here

Attempt 2

https://developer.android.com/studio/command-line/variables.html

ANDROID_AVD_HOME: Sets the path to the directory that contains all AVD-specific files, which mostly consist of very large disk images. The default location is $ANDROID_EMULATOR_HOME/avd/. You might want to specify a new location if the default location is low on disk space.

This should be exactly what I need, trying this solution again:

export ANDROID_SDK_ROOT="/Volumes/1TB/Android/"
export ANDROID_EMULATOR_HOME="/Volumes/1TB/emulator/"
export ANDROID_AVD_HOME="/Volumes/1TB/emulator/avd/"

23 seconds video: https://youtu.be/8bPv85RnzP4 😢

Attempt 3

Formatted and partitioned the external SSD.

enter image description here

enter image description here

It doesn't start, see the split-second popup 😢


Handy answer to go nuclear: https://stackoverflow.com/a/45669617/775359

rm -Rf /Applications/Android\ Studio.app
rm -Rf ~/Library/Preferences/AndroidStudio*
rm ~/Library/Preferences/com.google.android.studio.plist
rm -Rf ~/Library/Application\ Support/AndroidStudio*
rm -Rf ~/Library/Logs/AndroidStudio*
rm -Rf ~/Library/Caches/AndroidStudio*
rm -Rf ~/AndroidStudioProjects
rm -Rf ~/.gradle
rm -Rf ~/.android
rm -Rf ~/Library/Android*
3
  • Move your SDK to SSD and update SDK path in your projects local.properties file. Nov 22 '19 at 10:16
  • @VatishSharma I tried and discovered some troubles with such an approach. 1️⃣ I can run AVD in isolation from any project 2️⃣ the local.properties says explicitly: Do not modify this file -- YOUR CHANGES WILL BE ERASED! ➡️ i tried anyway but the duplicate of existing device or a new AVD lands in the old location /Users/ms/.android/avd/demo_test_try.avd Nov 27 '19 at 17:35
  • I am not sure how it can be fixed but I have some suggestions: 1. Instead of export * in Attempt2, try adding export ANDROID_HOME=<Path to Android SDK> 2. Trying changing the Android SDK path in Android Studio Settings. 3. Move the SDK from the location Android Studio is currently using to another location and then Android Studio will give an error saying to configure the SDK. Nov 28 '19 at 5:03
0

1) There is a solution here: Move Android Studio Virtual Devices to Another Hard Drive on a Mac . I will outline it later.

2.A) I am using Linux but my emulator is found under the Android SDK folder:/mnt/DATA/Android/Sdk/emulator (ON MY NVME M.2 BOOTABLE SSD) and my AVDs are located in /mnt/DATA1/.android/avd (on my 2ND SSD) and are accessible to Android Studio and the AVD Manager through the Symbolic Link to /mnt/DATA1/.android/avd stored in my ~/.android folder (ALSO ON MY NVME M.2 BOOTABLE SSD).

2.B) I copied the avd Folder from ~/.android to my Prefered Location, renamed he UNWANTED avd Folder avd.OLD (just in case), created a symbolic link to the desired avd folder, and copied the symbolic link to the ~/.android directory with the name avd.

2.C) I also ensured the Paths in the ini files point to the Physical location of the AVDs. for example: path=/mnt/DATA1/.android/avd/3.2_HVGA_slider_ADP1_API_29.avd

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.