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

发布于 2024-09-07 08:49:29 字数 225 浏览 1 评论 0 原文

安装 Android SDK 后,会在 E:\ 驱动器上创建文件夹 .android。据我所知,这是Android虚拟设备的默认配置文件文件夹。

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

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

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

How can I move .android folder to a different location?

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

离旧人 2024-09-14 08:49:30

如果您寻求这个答案,请注意此注释
从 Android Studio 4.2 开始,ANDROID_SDK_HOME 环境变量已弃用,并已替换为 ANDROID_PREFS_ROOT。

If you go for this answer be aware of this note:
Starting with Android Studio 4.2, the ANDROID_SDK_HOME environment variable is deprecated and has been replaced with ANDROID_PREFS_ROOT.

生生漫 2024-09-14 08:49:30

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

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

丢了幸福的猪 2024-09-14 08:49:30

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

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

遥远的绿洲 2024-09-14 08:49:30
  1. (可选)下载快速环境编辑器
  2. 添加新的系统变量

ANDROID_PREFS_ROOT = D:\IDE\Externals\ANDROID_PREFS_ROOT(您要移动到的文件夹。)

  1. 保存即可完成。
  1. (Optional) Download Rapid Environment Editor
  2. Add a new system variable

ANDROID_PREFS_ROOT = D:\IDE\Externals\ANDROID_PREFS_ROOT (The folder you want to move to.)

  1. Save and you're done.
浪荡不羁 2024-09-14 08:49:30

选择的答案有点过时了。

长颈鹿 | 2022.3.1(稳定):更改默认的 android avd 文件夹时,需要为 ANDROID_USER_HOME 添加新的环境变量。在您的情况下,该值应指向新文件夹的位置:

ANDROID_USER_HOME = E:\Android\.android

如果您的 android studio 版本较低(4.3 或更早版本),则必须使用 ANDROID_SDK_HOME 而不是 ANDROID_USER_HOME< /强>。

ANDROID_SDK_HOME = E:\Android

覆盖这些的用户首选项位置
旧工具,将 ANDROID_SDK_HOME 设置为您想要的父目录
就像要在下面创建的 .android 目录一样。

如果您有 AVD,并且在更改 .android 文件夹的位置后无法运行它们。

抛出错误运行模拟器时

那么您可能需要查看每个 AVD 的 *.ini 配置文件。它位于 avd 文件夹内 E:\Android\.android\avd
在AVD 文件夹

如果每个模拟器的路径没有指向新的指定位置,请更正它。
正确方式AVD 路径

Chosen answer is kinda outdated.

As of Giraffe | 2022.3.1 (Stable): when changing the default android avd folder, you need to add a new environment variable for ANDROID_USER_HOME. The value should lead to the location of the new folder, in your case:

ANDROID_USER_HOME = E:\Android\.android

If you have android studio with a lower version (4.3 or earlier), you have to use ANDROID_SDK_HOME instead of ANDROID_USER_HOME.

ANDROID_SDK_HOME = E:\Android

To override the user preferences location for those
older tools, set ANDROID_SDK_HOME to the parent directory you would
like the .android directory to be created under.

If you have AVDs and you're not able to run them after changing the location of the .android folder.

Error thrown when running an emulator

Then you might want to look at the *.ini configuration file of each of your AVDs. It is located inside the avd folder E:\Android\.android\avd
Inside the AVD folder

If each emulator's path does not lead to the new specified location, correct it.
Correct way of AVD paths

烟沫凡尘 2024-09-14 08:49:30

如果您只想移动 AVD 文件夹而不移动其他所有内容,请使用这些环境变量。

ANDROID_EMULATOR_HOME:设置用户特定的模拟器配置目录的路径。默认位置是
$ANDROID_SDK_HOME/.android/.

ANDROID_AVD_HOME:设置包含所有 AVD 特定文件的目录路径,这些文件主要由非常大的磁盘映像组成。默认位置是 $ANDROID_EMULATOR_HOME/avd/。如果默认位置磁盘空间不足,您可能需要指定一个新位置。

If you want to move just the AVD folder and not everything else, use those environmental variables.

ANDROID_EMULATOR_HOME: Sets the path to the user-specific emulator configuration directory. The default location is
$ANDROID_SDK_HOME/.android/.

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.

旧时模样 2024-09-14 08:49:30

如果您希望将 avd SD 卡和文件放在不同的驱动器上,请转至 $HOME/.android/avd 并将文件夹 .avd 移动到其他位置

编辑 $HOME/.android/avd/.ini 并更改

path=<NEW_AVD_LOCATION>/<AVD_NAME>.avd

$HOME 取决于您的系统。在 Windows 上,它可以是您的用户目录

If you would like your avd sdcard and files on a different drive, go to $HOME/.android/avd and move the folder <AVD_NAME>.avd to someplace else

Edit $HOME/.android/avd/<AVD_NAME>.ini and change

path=<NEW_AVD_LOCATION>/<AVD_NAME>.avd

$HOME depends on your system. On windows it can be your user directory

甜是你 2024-09-14 08:49:29

我找到了答案。

  • .android 文件夹移动到 E:\Android
  • 创建名为的环境变量
    ANDROID_SDK_HOME 并将其值设置为
    E:\Android

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

  1. 右键单击我的电脑并选择“属性”
  2. 单击“高级”选项卡
  3. 单击“环境变量”按钮。
  4. 添加新变量

I've found the answer.

  • Move .android folder to E:\Android
  • Create environment variable called
    ANDROID_SDK_HOME and set its value to
    E:\Android

Setting the environment variable on Windows XP or 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
Hello爱情风 2024-09-14 08:49:29

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

模拟器按照$ANDROID_AVD_HOME$ANDROID_SDK_HOME/.android/avd/$HOME/.android/avd中的值的顺序搜索avd目录/

本页提供了 android studio 支持的环境变量列表:https://developer.android。 com/studio/命令行/变量

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.

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/.

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文