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

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

问题描述

我知道这是一个非常基本的问题,但是令我惊讶的是,我找不到任何有关Android SDK Build-tools的文档. 除了Android SDK工具和Android SDK平台工具外,还有许多Android SDK构建工具,如所附屏幕截图所示.任何人都可以指向一个源代码解释所有这些源代码,并帮助阐明如何选择使用某个版本的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):

我仍然不完全了解所有工具.以下是我对Google最新文档的有限理解:

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

  • Android SDK生成工具曾经是 Android SDK平台工具的组成部分.它们已与Android SDK平台工具脱钩,因此可以独立于集成开发环境(IDE)组件来更新构建工具.
  • Android SDK平台工具是自定义的,以支持最新的Android平台的功能.它们向后兼容,因此即使您的应用程序定位到较旧的Android平台,您也始终使用 Android SDK平台工具的最新更新.
  • 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平台工具中删除 Android SDK生成工具的理由.我能想到的唯一可能的原因是,某些应用程序必须依赖于较早的构建组件来构建它们. Google的文档中提到了这一点,但没有解释原因.查看发行说明,您会发现 Android SDK Build-tools 的更新主要用于修复错误或添加对新平台的支持.我可以想到的是,某些应用程序使用旧版本的 Android SDK生成工具的唯一原因是它们依赖于 Android SDK生成工具的某些错误.如果没有这些bug,这些应用将无法正常运行.我希望Google可以提供一个或两个示例,说明为什么这些工具中的错误对于某些应用程序至关重要,因此可以更好地解释这一点.

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.

[build]工具(例如aidl,aapt,dexdump和dx)是 通常由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.

来源

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

Anyway, here is a synthesis of the differences between tools, platform-tools and build-tools:

  • Android SDK工具
    • 位置:$ANDROID_HOME/tools
    • 主要工具:蚂蚁脚本(用于构建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天全站免登陆