移动默认 AVD 配置文件夹 (.android)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3109473/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 08:44:21  来源:igfitidea点击:

Moving default AVD configuration folder (.android)

windowsandroidandroid-emulatoravd

提问by Dariusz Bacinski

After installation of Android SDK, there was created .androidfolder on the E:\drive. As far as I know this is the default folder of Android Virtual Devices for configuration files.

安装 Android SDK 后,.androidE:\驱动器上创建了文件夹。据我所知,这是 Android Virtual Devices 配置文件的默认文件夹。

How can I move .androidfolder to a different location?

如何将.android文件夹移动到其他位置?

(eg. from E:\.androidto E:\Android\.android)

(例如,从E:\.androidE:\Android\.android

回答by Dariusz Bacinski

I've found the answer.

我找到了答案。

  • Move .androidfolder to E:\Android
  • Create environment variable called ANDROID_SDK_HOMEand set its value to E:\Android
  • .android文件夹移动到E:\Android
  • 创建名为ANDROID_SDK_HOME 的环境变量 并将其值设置为 E:\Android

Setting the environment variable on Windows XP or Windows 7:

在 Windows XP 或 Windows 7 上设置环境变量:

  1. Right-click on My Computer and choose "Properties"
  2. Click the "Advanced" tab
  3. Click the button "Environment Variables".
  4. Add New variable
  1. 右键单击我的电脑并选择“属性”
  2. 单击“高级”选项卡
  3. 单击“环境变量”按钮。
  4. 添加新变量

回答by RonTLV

By default, the emulator stores configuration files under $HOME/.android/and AVD data under $HOME/.android/avd/. You can override the defaults by setting the following environment variables.

默认情况下,模拟器将配置文件$HOME/.android/存储在$HOME/.android/avd/. 您可以通过设置以下环境变量来覆盖默认值。

The emulator searches the avd directory in the order of the values in $ANDROID_AVD_HOME, $ANDROID_SDK_HOME/.android/avd/, and $HOME/.android/avd/.

仿真器搜索中值的顺序AVD目录$ANDROID_AVD_HOME$ANDROID_SDK_HOME/.android/avd/$HOME/.android/avd/

This page provides the list of environmental variables supported by android studio: https://developer.android.com/studio/command-line/variables

本页提供了android studio支持的环境变量列表:https: //developer.android.com/studio/command-line/variables

回答by robbash

The path set in ANDROID_SDK_HOMEmust exist. Otherwise the default path will be chosen. But it is not necessary to include .android. The AVD Manager creates a .androidfolder, if not found in ANDROID_SDK_HOME.

设置的路径ANDROID_SDK_HOME必须存在。否则将选择默认路径。但没有必要包括.android. AVD 管理器会创建一个.android文件夹,如果在ANDROID_SDK_HOME.

回答by shmoo

In addition to the answer provided by Dariusz Bacinski, you have to include the .androidfolder in the ANDROID_SDK_HOMEpath. It was not working for me if I did not include the .androidfolder.

除了 提供的答案外Dariusz Bacinski,您还必须.androidANDROID_SDK_HOME路径中包含文件夹。如果我不包含该.android文件夹,它对我不起作用。