在命令行上卸载Android SDK的所选部分 [英] Uninstalling selected parts of Android SDK on the command line
问题描述
这与卸载旧版Android SDK版本有关, d想在无头的Linux CI服务器(磁盘空间不足)上执行此操作。
This is related to "Uninstall old Android SDK versions", except I'd want to do it on a headless Linux CI server (short on disk space).
android
命令行工具提供了用于删除SDK的旧版本的选项?快速查看,只有AVD可以删除。我忽略了什么?
Does the android
command line tool provide options for removing older parts of the SDK? With a quick look, the only things it can delete are AVDs. Did I overlook something?
或者,我想我可以手动删除SDK_HOME下的内容。但什么东西可以安全删除?其他候选人呢?
Alternatively, I guess I could just manually delete stuff from under SDK_HOME. But what things are safe to delete? Other candidates than these?
- 我只需要支持API级别14及以上,因此我想我可以删除
> platforms / 喜欢
android-3
和android-4
b $ b -
docs
(800MB),示例
(300MB) -
system-images
如何?我需要例如android-18 / armeabi-v7a /
和android-18 / x86 /
如果我只想做自动化APK构建(没有模拟器东西)使用Gradle(和Ant)?
- I only need to support API level 14 and up, so I suppose I can delete
stuff under
platforms/
likeandroid-3
andandroid-4
. docs
(800MB),samples
(300MB)- How about
system-images
? Do I need e.g.android-18/armeabi-v7a/
andandroid-18/x86/
if I only want to do automated APK builds (no emulator stuff) using Gradle (and Ant)?
至少在删除 docs
完全,下次我运行 android更新sdk --no-ui
,它开始重新获取它们:
At least upon deleting docs
completely, the next time I ran android update sdk --no-ui
, it started fetching them again:
Downloading Documentation for Android SDK, API 19, revision 1
我可以避免更新
添加我丢弃的SDK的部分吗?
Can I avoid update
adding back parts of the SDK that I threw away?
免责声明:是的,磁盘是便宜,真的我应该添加更多。但现在在这个特定的服务器(8.5G磁盘)我没有这个选项,但我仍然想让它运行Android 19的建设...
Disclaimer: yes, disk is cheap and really I should just add more. But right now on this particular server (8.5G disk) I don't have that option, yet I'd still like to get it to run Android 19 builds...
推荐答案
除了tools /之外的任何东西都可以通过
Anything except tools/ can be re-installed generally with an
android list sdk -a
和
android update sdk --no-ui -a --filter <#index>
我会经常吹掉我的附加组件和构建工具/文件夹并重新安装我的add- ons /和build-tools /。如果您需要自动接受许可证,另一个小技巧是以下,至少如果你一次安装一个:
I will often blow away my add-ons/ and build-tools/ folders and reinstall my add-ons/ and build-tools/. If you need to automate accepting the license, another little trick is the following, at least if you're installing them one at a time:
android update sdk --no-ui -a --filter <#index> 0<<EOF
y
EOF
在SDK工具包或工具/目录,所以你不能删除,因为那样你不能安装任何其他。我也通常不会删除platform-tools /,因为你不能建立任何东西,除非你安装一个新的/旧的版本。如果您在< sdk-folder> / SDK Readme.txt下,您将看到第一段中的以下内容以确认:
The "android" command itself lives within the "SDK Tools" package or tools/ directory, so you can't remove that, because then you can't install anything else. I also generally wouldn't remove platform-tools/, as then you can't build anything, unless you're installing a new/older version. If you look under <sdk-folder>/SDK Readme.txt, you will see the following in the first paragraph to confirm this:
欢迎使用Android SDK!
Welcome to the Android SDK!
Android SDK封存最初只包含基本的SDK工具。它不包含Android平台或任何第三方库。实际上,它甚至没有开发应用程序所需的所有工具。
The Android SDK archive initially contains only the basic SDK tools. It does not contain an Android platform or any third-party libraries. In fact, it doesn't even have all the tools you need to develop an application.
为了开始开发应用程序,您必须安装Platform-tools和至少一个版本的Android平台,使用SDK管理器。
In order to start developing applications, you must install the Platform-tools and at least one version of the Android platform, using the SDK Manager.
这篇关于在命令行上卸载Android SDK的所选部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!