What are the Android SDK build-tools, platform-tools and tools? And which version should be used?

前端 未结 6 1757
北荒
北荒 2020-11-28 17:27

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 Platfo

相关标签:
6条回答
  • 2020-11-28 17:43

    I'll leave the discussion of the difference between Build Tools, Platform Tools, and Tools to others. From a practical standpoint, you only need to know the answer to your second question:

    Which version should be used?

    Answer: Use the most recent version.

    For those using Android Studio with Gradle, the buildToolsVersion has to be set in the build.gradle (Module: app) file.

    android {
        compileSdkVersion 25
        buildToolsVersion "25.0.2"
    
        ...
    }
    

    Where do I get the most recent version number of Build Tools?

    Open the Android SDK Manager.

    • In Android Studio go to Tools > Android > SDK Manager > Appearance & Behavior > System Settings > Android SDK
    • Choose the SDK Tools tab.
    • Select Android SDK Build Tools from the list
    • Check Show Package Details.

    The last item will show the most recent version.

    Make sure it is installed and then write that number as the buildToolsVersion in build.gradle (Module: app).

    0 讨论(0)
  • 2020-11-28 17:45

    Android SDK build tools are used to debug, build, run and test an Android application.

    Android Build Tools can be used to develop and work from command line or IDE (i.e Eclipse or Android Studio).

    Also used to connect Android devices and root them.(fastboot, adb and more..)

    Always use the latest.(Recommended)

    More Info on Android Build tools and commands

    0 讨论(0)
  • 2020-11-28 17:56

    The right answer is

    Decoupled the build-specific components of the Android SDK from the platform-tools component, so that the build tools can be updated independently of the integrated development environment (IDE) components.

    link (expand Revision 17)

    0 讨论(0)
  • 2020-11-28 17:56

    Android SDK Build Tools are exactly what the name says they are; tools for building Android Applications.It is very important to use the latest build tools version (selected automatically by your IDE via the Android SDK) but the reason the old versions are left there is to support backward compatibility, that is If your projects depend on older versions of the Build Tools.

    0 讨论(0)
  • 2020-11-28 17:59

    About the version of Android SDK Build-tools, the answer is

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

    Source

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

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

    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.

    Source

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

    • Android SDK Tools
      • Location: $ANDROID_HOME/tools
      • Main tools: ant scripts (to build your APKs) and ddms (for debugging)
    • Android SDK Platform-tools
      • Location: $ANDROID_HOME/platform-tools
      • Main tool: adb (to manage the state of an emulator or an Android device)
    • Android SDK Build-tools
      • 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)
    0 讨论(0)
  • 2020-11-28 18:03

    You can find details about these in this Android - Command Line Tools


    tl;dr:

    SDK Tools:

    1. Android SDK Manager (sdkmanager)
    2. AVD Manager (avdmanager)
    3. Dalvik Debug Monitor Server (ddms)

    Build Tools:

    1. signer
    2. proGuard
    3. zipalign
    4. jobb

    Platform Tools:

    1. adb
    2. aidl, aapt, dexdump, and dx
    3. bmgr
    4. logcat
    0 讨论(0)
提交回复
热议问题