简体   繁体   English

迷上了android-studio和android-sdk

[英]Messed up with android-studio and android-sdk

I'm trying to setup minimal environment for Android development on Arch linux. 我正在尝试为Arch Linux上的Android开发设置最小的环境。 I've installed the following AUR packages: android-sdk, android-sdk-platform-tools, android-sdk-build-tools and android-studio. 我已经安装了以下AUR软件包:android-sdk,android-sdk-platform-tools,android-sdk-build-tools和android-studio。 I see that they were installed under /opt/android-s{dk,studio} directories. 我看到它们安装在/opt/android-s{dk,studio}目录下。 It was quite smooth so far, but when I start Android studio, it ask me where I want to place my working directory which I set to ~/Android . 到目前为止,一切都非常顺利,但是当我启动Android Studio时,它会问我要将设置为~/Android工作目录放在哪里。 After I installed some platform API (which unfortunately didn't installed successfully) I see that the directory structure and files under /opt/android-sdk and ~/Android/Sdk/ are quite similar: 安装一些平台API(不幸的是未成功安装)后,我发现/opt/android-sdk~/Android/Sdk/下的目录结构和文件非常相似:

ls /opt/android-sdk
add-ons  build-tools  platforms  platform-tools  sources  system-images  temp  tools


ls ~/Android/Sdk/
add-ons  build-tools  extras  licenses  platforms  platform-tools  'SDK Readme.txt'  skins  sources  system-images  tools

So, where is some kind of primary directory for installing all of the Android environment tools? 那么,用于安装所有Android环境工具的某种目录在哪里? I can't get the relation between installing packages through Android studio and android sdk command. 我无法通过Android Studio和android sdk命令安装软件包之间的关系。 It seems like they duplicate each other. 好像他们互相复制。

In addition, what about setting the follwoing env variables: 此外,如何设置以下环境变量:

#Is this correct in my case? 
#Also, what is the difference? I didn't find information on this.
export ANDROID_HOME=/opt/android-sdk
export ANDROID_SDK_ROOT=$HOME/Android/Sdk

One of the reason of the questioning is necessity to move /opt/adnroid-* folders into another directory (take too much space). 质疑的原因之一是有必要将/opt/adnroid-*文件夹移动到另一个目录(占用太多空间)。 Thank you in advance! 先感谢您!

You should have only one "Android" directory. 您应该只有一个“ Android”目录。 When you installed AS it probably installed a new copy of the SDK in the user directory. 安装AS时,它可能在用户目录中安装了SDK的新副本。

Try changing the SDK location in AS settings to /opt/android-sdk and deleting the ~/Android directory. 尝试将AS设置中的SDK位置更改为/ opt / android-sdk并删除〜/ Android目录。 Then set both ANDROID_HOME and ANDROID_SDK_ROOT to /opt/android-sdk. 然后将ANDROID_HOME和ANDROID_SDK_ROOT都设置为/ opt / android-sdk。

Or do it backwards and delete the one in /opt folder if you like having it in the user directory. 或者,如果您希望将它放在用户目录中,则将其倒退并删除/ opt文件夹中的一个。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM