Search code examples
android-studioenvironment-variablesavd-manager

Android Studio AVD Manager - setting environmental variable doesn't work


Goal:
manage Android Virtual Devices (avd) using the (graphical) AVD manager shipped with Android Studio, but using a different storage folder.
Default folder: /home/user1/.android/avd/
Wanted folder: /mnt/data/some/more/path/.android/avd

According to the docs, this should work:
(Loaded in .bashrc)

export ANDROID_SDK_HOME='/mnt/data/some/more/path'
export ANDROID_EMULATOR_HOME="${ANDROID_SDK_HOME}/.android"
export ANDROID_AVD_HOME="${ANDROID_EMULATOR_HOME}/avd"
export ANDROID_SDK_ROOT='/mnt/data/some/more/path/Sdk'
export PATH="${PATH}:${ANDROID_SDK_ROOT}/emulator"
export PATH="${PATH}:${ANDROID_SDK_ROOT}/tools"
export PATH="${PATH}:${ANDROID_SDK_ROOT}/tools/bin"
export PATH="${PATH}:${ANDROID_SDK_ROOT}/platform-tools"

This works indeed on the command line:

$ emulator -list-avds
Nexus_5X_API_29_x86
Pixel_2_API_28

and running emulator -avd Pixel_2_API_28 works fine too.

However, AVD manager shows me no devices and when I use the only visible button + Create Virtual Device..., the new device will be created in the Default folder (/home/user1/.android/avd).

Worth mentioning (but I don't know if related): In settings>Tools>Terminal > And then looking at the list of Environment Variables, I cannot find eg. $ANDROID_SDK_HOME under 'Include system environment variables'. But at the other side, when opening a terminal in Android Studio, they are available.

Am I doing something wrong or is this a bug (and should I rapport it)?

Thanks

Environment:
Linux Mint 19.3 Cinnamon
Android Studio 3.6.3


Solution

  • After searching some more, this bug is already reported: https://issuetracker.google.com/152333601

    Star this issue there if this bothers you too.