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


当前回答

在我的例子中,我关心的是C:驱动器磁盘空间。 所以我所做的就是复制。Avd "文件夹(不是文件)到其他驱动器,并留下".ini"文件,但改变它指向移动

其他回答

环境变量ANDROID_AVD_HOME可以用来定义AVD管理器查找AVD INI文件的目录,因此可以用来改变虚拟设备的位置;

默认值为%USERPROFILE%\。android\avd在Windows(或~/。Linux上的android/avd)。

也可以为整个目录%USERPROFILE%\创建一个链接。Windows上的android(或目录~/的符号链接)。Linux上的android)。

移动AVD时,AVD INI文件中的路径条目需要相应更新。

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

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

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

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

看看这个。 使用android命令创建avd,您可以指定文件放置的位置。

-p --path     Location path of the directory where the new AVD will be created

移动你的。android到任何你想要的地方。

然后,创建一个像这样的符号链接:

# In your home folder
$ ln -s /path/to/.android/ .

这只是告诉Linux无论何时路径~/。Android被任何应用程序引用,链接到/path/to/. Android。

我关注了https://www.mysysadmintips.com/windows/clients/761-move-android-studio-avd-folder-to-a-new-location。

Start copying a folder "C:\Users\user\.android\avd" to "D:\Android\.android\avd" (or something else). Close Android Studio and running emulators. Press Win + Break and open Advanced System Settings. Then press Environment Variables. Add a user variable ANDROID_SDK_HOME. (I didn't experiment with ANDROID_AVD_HOME.) In Variable value field write D:\Android. If you also moved SDK to another folder, change ANDROID_HOME (I forgot to change it and some emulators didn't launch, see https://stackoverflow.com/a/57408085/2914140). Wait until the folder will finish copying and start Android Studio. Open Android Virtual Device Manager and see a list of emulators. If you don't see emulators and they existed, then probably you entered wrong path into user variable value in step 3. In this case close AS, change the variable and open AS again. Start any emulator. It will try to restore it's state, but it sometimes fails. A black screen can appear instead of Android wallpaper. In this case you can: a. Restart your emulator. To do this close running emulator, then in AVD Manager click Cold Boot Now.

b.如果这没有帮助,打开模拟器设置,在文件“D:\Android\. Android\ avd\Pixel_API_27.ini”中找到。

更改路径到一个新的AVD文件夹。重新启动模拟器。

删除旧的AVD文件夹从“C:\Users\user\.android\ AVD”