Linux 什么是安装 Android SDK 的合适目录?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7535569/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-05 06:19:55  来源:igfitidea点击:

What is an appropriate directory in which to install Android SDK?

androidlinux

提问by Translucent Pain

I don't use java much so what are the common (best practice) locations to install components like this. I want to put them in a system directory so multiple users have access.

我不太使用java,所以安装此类组件的常见(最佳实践)位置是什么。我想将它们放在系统目录中,以便多个用户可以访问。

采纳答案by Justin ??????

Common locations are /opt, /srv, and /usr/local. I tend to lean toward /usr/local.

常见的位置是/opt/srv/usr/local。我倾向于倾向于/usr/local

Note that the Android SDK doesn't really require you to install much, it's mostly self-contained. All you need to do is tell Eclipse where it is. You may also want to add the toolsand/or platform-toolsdirectories to the system-wide PATH so that your users can use adb and other tools.

请注意,Android SDK 并不需要您安装太多东西,它主要是自包含的。您需要做的就是告诉 Eclipse 它在哪里。您可能还想将tools和/或platform-tools目录添加到系统范围的 PATH 中,以便您的用户可以使用 adb 和其他工具。

See http://developer.android.com/sdk/installing.html.

请参阅http://developer.android.com/sdk/installing.html

回答by coder_For_Life22

It doesnt matter where you put the sdk. Just put it in any folder where all user's can access it...

你把sdk放在哪里并不重要。只需将其放在所有用户都可以访问的任何文件夹中...

回答by Michael Aaron Safyan

On Linux, I typically use /usr/local/android-sdk, but anywhere that makes sense and that won't get clobbered by your system works. Just be aware that it may actually make sense to put the SDK in a per-user location, since it requires write access to create a VM image and to download SDK updates.

在 Linux 上,我通常使用/usr/local/android-sdk, 但任何有意义且不会被您的系统破坏的地方都可以使用。请注意,将 SDK 放在每个用户的位置实际上可能是有意义的,因为它需要写入权限才能创建 VM 映像和下载 SDK 更新。

回答by Mateo Upegui Borja

To be more concise and allow user writing for things like sdk installations and etc, you could put it somewhere inside the ~/.localdirectory as per the XDG file system hierarchylike ~/.local/lib/arch-id/android-sdkAlso remember to set the ANDROID_SDK_ROOTenv variable to that directory as the ANDROID_HOMEvariable was deprecated.

为了更简洁并允许用户编写 sdk 安装等内容,您可以~/.local根据XDG 文件系统层次结构将其放在目录中的某个位置,例如~/.local/lib/arch-id/android-sdk还记得将ANDROID_SDK_ROOTenv 变量设置为该目录,因为该ANDROID_HOME变量已被弃用。