我已经在运行Windows XP的机器上设置了Android SDK和Eclipse, avd (Android虚拟设备)保存到“文档和设置\user\。默认为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文件,只需用你的新路径替换它
其他回答
另一种指定ANDROID_SDK_HOME而不涉及环境变量的方法(特别是在使用ec2时)是简单地创建一个eclipse快捷方式并添加以下内容作为目标
C:\ windows \ system32 \cmd.exe /C "setx ANDROID_SDK_HOME你的AVD路径/M &你的ECLIPSE.EXE路径"
这将在启动eclipse时将ANDROID_SDK_HOME设置为系统变量。
HTH 保罗
根据官方文档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文件,只需用你的新路径替换它
添加一个新的用户环境变量(Windows 7): 开始菜单>控制面板>系统>高级系统设置(左侧)>环境变量 添加一个新的用户变量(在顶部),指向你的主用户目录:
变量名称:ANDROID_SDK_HOME变量值: 您选择的目录的路径
AVD管理器将使用这个目录保存它的.android目录。
对于那些可能感兴趣的人,我在博客中谈到了我第一次涉足Android开发…… Android“Hello World”:一个悲惨的故事
或者,您也可以使用快速环境编辑器来设置环境变量。
我认为最简单的方法是从C:\Users[USER]移动avd文件夹。然后在C:\Users[USER]中创建一个指向它的符号链接。Android同名。
如果你想知道如何做到这一点,首先安装链接外壳扩展。在文件夹移动后,右键单击它,选择选择链接源,然后右键单击。android文件夹,然后在Drop As…子菜单选择符号链接。
MacOs 获取目录广告
./emulator -help-datadir
默认目录为:
/Users/{your_computer_user_name}/.android
然后转到avd文件夹编辑。ini文件的路径到您的自定义模拟器目录 例子:
path = - Volumes Macintos / _emulatorandroid avd / Nexus_5X_API_27 avd。 path avd = avd / Nexus_5X_API_27轨道。 目标= android-27
然后保存。现在你的模拟器已经改变了
和结果:
推荐文章
- 无法在Windows上从/usr/local/ssl/openssl.cnf加载配置信息
- Android - SPAN_EXCLUSIVE_EXCLUSIVE跨度不能为零长度
- TextView的字体大小在Android应用程序改变字体大小从本机设置
- 如何模拟Android杀死我的进程
- 禁用EditText闪烁光标
- Android Eclipse -无法找到*.apk
- 设置TextView文本从html格式的字符串资源在XML
- 如何允许所有网络连接类型HTTP和HTTPS在Android(9)馅饼?
- Android加载JS包失败
- Android Studio, logcat在应用程序关闭后清理
- 在android中从上下文获取活动
- 无法解析主机"<URL here>"没有与主机名关联的地址
- getActivity()在Fragment函数中返回null
- 按钮背景是透明的
- 在Mac OS X上哪里安装Android SDK ?