什么是 Android SDK 构建工具、平台工具和工具?应该使用哪个版本? [英] What are the Android SDK build-tools, platform-tools and tools? And which version should be used?

查看:25
本文介绍了什么是 Android SDK 构建工具、平台工具和工具?应该使用哪个版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这是一个非常初级的问题,但令我惊讶的是,我找不到任何关于 Android SDK Build-tools 的文档.除了 Android SDK Tools 和 Android SDK Platform-tools,还有一堆 Android SDK Build-tools,如附加的屏幕截图所示.谁能指出一个解释所有这些的来源并帮助澄清如何选择使用某个版本的 Android SDK 构建工具?

I know this is a very rudimentary question, but to my surprise, I could not find any document about Android SDK Build-tools. Besides Android SDK Tools and Android SDK Platform-tools, there are a bunch of Android SDK Build-tools as shown in the appended screenshot. Could anyone point to a source explaining all of them and help clarifying how a certain version of Android SDK Build-tools is picked for use?

已编辑 (2014-02-27):

我仍然没有完全理解所有的工具.以下是我基于谷歌最新文档的有限理解:

I still do not fully understand all the tools. The following is my limited understanding based on Google's latest documents:

  • Android SDK Build-tools 曾经是 Android SDK Platform-tools 的组件.它们已与 Android SDK 平台工具分离,因此构建工具可以独立于集成开发环境 (IDE) 组件进行更新.
  • Android SDK 平台工具经过定制以支持最新 Android 平台的功能.它们向后兼容,因此您始终使用 Android SDK 平台工具的最新更新,即使您的应用面向较旧的 Android 平台.
  • SDK 工具是独立于平台的,无论您在哪个 Android 平台上进行开发,都是必需的.
  • Android SDK Build-tools used to be components of Android SDK Platform-tools. They have been decoupled from Android SDK Platform-tools, so that the build tools can be updated independently of the integrated development environment (IDE) components.
  • Android SDK Platform-tools are customized to support the features of the latest Android platform. They are backward compatible so that you always use the latest update of Android SDK Platform-tools even your app targets older Android platforms.
  • SDK tools are platform independent and are required no matter which Android platform you are developing on.

我仍然不明白将 Android SDK Build-tools 从具有单一实例且易于管理更新的 Android SDK Platform-tools 中取出的基本原理.我能想到的唯一可能原因是某些应用程序必须依赖较旧的构建组件来构建它们.谷歌的文档提到了这一点,但没有解释原因.查看发行说明,您会注意到 Android SDK 构建工具 的更新主要用于修复错误或/添加对新平台的支持.对于某些应用程序使用旧版本的 Android SDK 构建工具,我能想到的唯一原因是它们依赖于 Android SDK 构建工具 的某些错误.如果没有这些错误,这些应用程序将无法正常运行.我希望谷歌可以通过举一两个例子来更好地解释这一点,说明为什么工具中的这些错误对某些应用程序至关重要.

I still do not understand the rationale of taking Android SDK Build-tools out of Android SDK Platform-tools which has a single instance and is easy to manage the update. The only possible reason that I can think of is that some apps have to rely on older build components to build them. Google's document mentions this, but does not explain why. Looking at the release notes, you will notice that updates of Android SDK Build-tools are primarily for fixing bugs or/add support for new platforms. The only reason that I can think of for some apps to use older versions of Android SDK Build-tools is that they rely on certain bugs of Android SDK Build-tools. These apps would not function normally without being built with these bugs. I wish Google could explain this better by giving one or two examples showing why these bugs in the tools are critical for certain apps.

推荐答案

关于Android SDK Build-tools的版本,答案是

默认情况下,Android SDK 使用最新下载的版本构建工具.

By default, the Android SDK uses the most recent downloaded version of the Build Tools.

来源

在 Eclipse 中,您可以使用 project.properties 文件中的 sdk.buildtools 属性来选择特定版本.

In Eclipse, you can choose a specific version by using the sdk.buildtools property in the project.properties file.

似乎没有解释所有构建工具的官方页面.以下是 Android 团队对此的看法.

There seems to be no official page explaining all the build tools. Here is what the Android team says about this.

aidl、aapt、dexdump 和 dx 等 [build] 工具是通常由 Android 构建工具或 Android 开发调用工具 (ADT),因此您很少需要直接调用这些工具.作为一个一般规则,您应该依靠构建工具或 ADT 插件来根据需要给他们打电话.

The [build] tools, such as aidl, aapt, dexdump, and dx, are typically called by the Android build tools or Android Development Tools (ADT), so you rarely need to invoke these tools directly. As a general rule, you should rely on the build tools or the ADT plugin to call them as needed.

来源

无论如何,这里是工具、平台工具和构建工具之间差异的综合:

  • Android SDK 工具
    • 位置:$ANDROID_HOME/tools
    • 主要工具:ant 脚本(用于构建您的 APK)和 ddms(用于调试)
    • Android SDK Tools
      • Location: $ANDROID_HOME/tools
      • Main tools: ant scripts (to build your APKs) and ddms (for debugging)
      • 位置:$ANDROID_HOME/platform-tools
      • 主要工具:adb(用于管理模拟器或 Android 设备的状态)
      • Location: $ANDROID_HOME/platform-tools
      • Main tool: adb (to manage the state of an emulator or an Android device)
      • 位置:$ANDROID_HOME/build-tools/$VERSION/
      • 文档
      • 主要工具:aapt(生成 R.java 和未对齐、未签名的 APK)、dx(将 Java 字节码转换为 Dalvik 字节码)和 zipalign(优化您的 APK)
      • Location: $ANDROID_HOME/build-tools/$VERSION/
      • Documentation
      • Main tools: aapt (to generate R.java and unaligned, unsigned APKs), dx (to convert Java bytecode to Dalvik bytecode), and zipalign (to optimize your APKs)

      这篇关于什么是 Android SDK 构建工具、平台工具和工具?应该使用哪个版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆