我已经在运行Windows XP的机器上设置了Android SDK和Eclipse, avd (Android虚拟设备)保存到“文档和设置\user\。默认为Android。有没有办法改变这种行为?我把所有其他组件都保存在一个单独的分区上的目录中,并希望所有内容都得到整合。显然不是什么大问题,但有人知道解决办法吗?
当前回答
主要有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
其他回答
看看这个。 使用android命令创建avd,您可以指定文件放置的位置。
-p --path Location path of the directory where the new AVD will be created
进入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"
环境变量ANDROID_AVD_HOME可以用来定义AVD管理器查找AVD INI文件的目录,因此可以用来改变虚拟设备的位置;
默认值为%USERPROFILE%\。android\avd在Windows(或~/。Linux上的android/avd)。
也可以为整个目录%USERPROFILE%\创建一个链接。Windows上的android(或目录~/的符号链接)。Linux上的android)。
移动AVD时,AVD INI文件中的路径条目需要相应更新。
用于Windows 10上的Visual Studio 2017
复制C:\Users\ YOURUSERNAME \。android文件夹到(例如)E:\avd
打开环境变量窗口:
进入设置,点击系统。 2 .在界面左侧单击“关于”,在界面右侧选择“系统信息” 底部。 在新窗口中,单击“Advanced system” 左边的设置。 点击环境变量 结果窗口的底部。
添加一个新变量:
变量名:ANDROID_SDK_HOME 变量值:一个目录的路径(例如E:\avd)
不要在变量值中包含.android。
重新启动Visual Studio。
更改SDK和NDK位置到:
工具->选项-> Xamarin -> Android设置
根据官方文档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文件,只需用你的新路径替换它
推荐文章
- 警告:API ' variable . getjavacompile()'已过时,已被' variable . getjavacompileprovider()'取代
- 安装APK时出现错误
- 碎片中的onCreateOptionsMenu
- TextView粗体通过XML文件?
- 如何使线性布局的孩子之间的空间?
- 我如何找到哪个程序正在使用端口80在Windows?
- 在Windows中有像GREP这样的模式匹配实用程序吗?
- DSL元素android.dataBinding。enabled'已过时,已被'android.buildFeatures.dataBinding'取代
- ConstraintLayout:以编程方式更改约束
- PANIC: AVD系统路径损坏。检查ANDROID_SDK_ROOT值
- 如何生成字符串类型的buildConfigField
- Recyclerview不调用onCreateViewHolder
- 如何在Windows命令提示符下运行.sh ?
- Android API 21工具栏填充
- Android L中不支持操作栏导航模式