我已经在运行Windows XP的机器上设置了Android SDK和Eclipse, avd (Android虚拟设备)保存到“文档和设置\user\。默认为Android。有没有办法改变这种行为?我把所有其他组件都保存在一个单独的分区上的目录中,并希望所有内容都得到整合。显然不是什么大问题,但有人知道解决办法吗?


当前回答

In Windows 10 I had that problem because My C Drive was getting full and I had needed free Space, AVD folder had 14 gig space so I needed to move that folder to another driver, first answer not work for Me so I tested another way to fix it this problem, I make a picture for you if you have the same problem, you don't need to move all of the files in .android folder to another drive (this way not work) just move avd folders in ....android\avd to another drive and open .ini files and change avd folder path from that file to the new path. Like this image:

我希望这对你有用。

注意:小心在ini文件的路径之前和之后有一个你看不到的单独的字符,如果你删除了那个字符,它就不起作用了

其他回答

在AVD管理器中,使用谷歌api的目标设置AVD后,运行时得到错误。

详细信息显示:“AVD未知目标'谷歌Inc.:谷歌api:......”

在安装期间(在Win7系统上),我选择了一个SDK目录位置,而不是接受c:\ users \… 然后我将该目录添加到环境变量path中 命令行:android列表目标确实显示了两个谷歌api。

设置ANDROID_SDK_HOME到我的安装路径修复了avd运行错误。

进入Android tools目录。编辑android.bat命令文件。在命令文件的末尾,找到类似于

call %java_exe% -Djava.ext.dirs=%java_ext_dirs% -Dcom.android.sdkmanager.toolsdir="%tools_dir%" -Dcom.android.sdkmanager.workdir="%work_dir%" -jar %jar_path% %*

和替换

call %java_exe%

with

call %java_exe% -Duser.home={your_prefer_dir}

{your_prefer_dire}是您的首选目录,不带大括号,但添加双引号,

如。

call %java_exe% -Duser.home="E:\Program Files (x86)\android-sdk-windows"

根据官方文档https://developer.android.com/studio/command-line/variables.html,您应该更改ANDROID_AVD_HOME environment var:

Emulator Environment Variables 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 -avd command searches the avd directory in the order of the values in $ANDROID_AVD_HOME, $ANDROID_SDK_HOME/.android/avd/, and $HOME/.android/avd/. For emulator environment variable help, type emulator -help-environment at the command line. For information about emulator command-line options, see Control the Emulator from the Command Line. 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.

在修改或设置ANDROID_AVD_HOME后,你必须将所有内容移动到~user/。Android /avd/到你的新位置,并改变路径到每个模拟器的ini文件,只需用你的新路径替换它

主要有4个步骤 1. 复制。Android文件夹到你想要的位置,就像我在D:\Android\.android中做的那样 2. 在环境变量ANDROID_AVD_HOME D:\Android\.android\avd中设置ANDROID_AVD_HOME 3.更改avd name.ini文件内容的新位置,如 avd.ini.encoding = utf - 8 路径= D: \安卓\ .android \ avd \ Pixel_2_API_29.avd path.rel = avd \ Pixel_2_API_29.avd 目标= android-29 4. 重启android studio

您可以更改新AVD的.ini文件:

target=android-7
path=C:\Users\username\.android\avd\VIRTUAL_DEVICE_NAME.avd

我不知道如何指定。ini文件应该存储在哪里:)