Linux环境下无法安装Android虚拟设备,如何修改AVD存储位置?
How to Change AVD Storage Location in Android Studio (Linux)
Hey there! Let's get that AVD storage issue sorted out—since your root partition is only 50GB, moving your Android Virtual Devices to the larger 410GB partition is the perfect fix. Here are two reliable methods to make this happen:
Method 1: Use Android Studio's Built-in Settings
This is the most straightforward approach if you prefer a GUI:
- Open Android Studio, go to
File→Settings(or use the shortcutCtrl+Alt+S). - In the left sidebar, navigate to
Appearance & Behavior→System Settings→Android SDK. - Switch to the SDK Location tab, then scroll down to the Emulator section.
- Click the
Changebutton next to the current AVD location, then select a dedicated folder on your 410GB partition (create one first if it doesn’t exist—something like/mnt/large-partition/android-avdsworks well). - Hit
ApplythenOK, and restart Android Studio. Any new AVDs you create will now save to this new location.
Method 2: Manual Configuration (Great for Command-Line Users or If Settings Fail)
If the GUI method doesn’t stick, you can adjust paths manually:
- Create a new AVD directory on your large partition:
mkdir -p /mnt/large-drive/android-avds - Move existing AVDs (if you have any) to the new location:
cp -r ~/.android/avd/* /mnt/large-drive/android-avds/ - Update the AVD manager config file:
Edit or create~/.android/avd/avdmanager.iniand add this line:avd.dir=/mnt/large-drive/android-avds - Set an environment variable:
Open your shell config file (like~/.bashrcor~/.zshrc) and add:
Apply the changes immediately with:export ANDROID_AVD_HOME=/mnt/large-drive/android-avdssource ~/.bashrc - Restart Android Studio, and your AVDs will now use the new storage location.
Important Notes
- Ensure your new AVD folder has proper read/write permissions:
chmod -R 755 /mnt/large-drive/android-avds - If you moved existing AVDs, check each AVD’s
config.inifile (inside its folder in the new location) to confirm paths likepathandfastboot.pathpoint to the new directory. Tweak them manually if needed.
内容的提问来源于stack exchange,提问作者Robin Good
相关产品推荐
相关产品推荐

