Android 官方独立 adb、fastboot、aapt、aapt2 工具包

 

Android 官方独立 adb / fastboot 工具包

工具包内容:

https://developer.android.google.cn/tools/releases/platform-tools?hl=zh-cn  SDK 平台工具版本说明

https://developer.android.google.cn/tools?hl=zh-cn  多个工具

 

commandlinetools 独立工具包

Android Studio 中包含命令行工具。如果您不需要 Android Studio,可以从上面下载基本的 Android 命令行工具。您可以使用随附的 sdkmanager 下载其他 SDK 软件包。

https://developer.android.google.cn/studio?hl=zh-cn  滑到页面最下面,进行下载

https://googledownloads.cn/android/repository/commandlinetools-win-13114758_latest.zip  window下载

工具包内容;

 

AAPT2工具下载

方法一 (需要FQ,获得最新版本aapt工具)

如需获得未捆绑在构建工具中的最新版 AAPT2,您可以从 Google 的 Maven 制品库下载 AAPT2,具体操作步骤如下:

  1. 制品库索引中(需要FQ才能打开),依次前往 com.android.tools.build > aapt2
  2. 复制最新版 AAPT2 的名称。
  3. 将复制的版本名称插入以下网址并指定目标操作系统: https://dl.google.com/dl/android/maven2/com/android/tools/build/aapt2/ aapt2-version/aapt2-aapt2-version- [windows | linux | osx].jar

    例如,如需下载适用于 Windows 的版本 3.2.0-alpha18-4804415,请使用: https://dl.google.com/dl/android/maven2/com/android/tools/build/aapt2/ 3.2.0-alpha18-4804415/aapt2-3.2.0-alpha18-4804415-windows.jar

  4. 在浏览器中前往该网址,系统将随即开始下载 AAPT2。

  5. 解压缩刚刚下载的 JAR 文件。(jar包里面包含了aapt2工具,解压jar文件,即可使用)

    JAR 文件应包含 aapt2 可执行文件和该可执行文件所依赖的一些库。

 

方法二

https://github.com/AndroidIDEOfficial/platform-tools/releases

https://github.com/AndroidIDEOfficial/platform-tools/releases/download/v34.0.4/aapt2-arm64-v8a    arm64版本,可以直接push到手机当中运行,下载后重命名为aapt

https://github.com/AndroidIDEOfficial/platform-tools/releases/download/v34.0.4/aapt2-armeabi-v7a      arm32版本,可以直接push到手机当中运行

https://github.com/AndroidIDEOfficial/platform-tools/releases/download/v34.0.4/platform-tools-34.0.4-aarch64.tar.xz  arm64版本,包含了aapt,adb,fastboot工具

https://github.com/AndroidIDEOfficial/platform-tools/releases/download/v34.0.4/platform-tools-34.0.4-arm.tar.xz  arm32版本

https://github.com/AndroidIDEOfficial/platform-tools/releases/download/v34.0.4/platform-tools-34.0.4-x86_64.tar.xz  非.exe文件,window版本不能运行

Android_aapt_aapt2_36.1.0.rar(蓝奏云 必装工具包)  window版本aapt、aapt2命令工具 2025最新版

 

image

将arm64版本aapt2工具 push到手机当中

adb shell rm -rf   /data/local/tmp/aapt  // 删除旧数据,若有
adb push  aapt /data/local/tmp
adb shell chmod 0755 /data/local/tmp/aapt

# 查看aapt2版本

$ adb shell  /data/local/tmp/aapt version
Android Asset Packaging Tool (aapt) 2.19-eng.202510

# 查看aapt2用法

$ adb shell  /data/local/tmp/aapt
error: no subcommand specified.
aapt2 [subcommand] [options] files...

Subcommands:
 compile                                           Compiles resources to be linked into an apk.
 link                                              Links resources into an apk.
 dump
 diff                                              Prints the differences in resources of two apks.
 optimize                                          Preforms resource optimizations on an apk.
 convert                                           Converts an apk between binary and proto formats.
 version                                           Prints the version of aapt.
 daemon                                            Runs aapt in daemon mode. Each subsequent line is a single parameter to the
                                                   command. The end of an invocation is signaled by providing an empty line.

Options:
 -h                                                Displays this help menu

# 查看aapt dump用法

$ adb shell  /data/local/tmp/aapt dump -h
aapt2 dump [subcommand] [options] files...

Subcommands:
 apc                                               Print the contents of the AAPT2 Container (APC) generated fom compilation.
 badging                                           Print information extracted from the manifest of the APK.
 configurations                                    Print every configuration used by a resource in the APK.
 packagename                                       Print the package name of the APK.
 permissions                                       Print the permissions extracted from the manifest of the APK.
 strings                                           Print the contents of the resource table string pool in the APK.
 styleparents                                      Print the parents of a style in an APK.
 resources                                         Print the contents of the resource table from the APK.
 chunks                                            Print the chunk information of the compiled resources.arsc in the APK.
 xmlstrings                                        Print the string pool of a compiled xml in an APK.
 xmltree                                           Print the tree of a compiled xml in an APK.
 overlayable                                       Print the <overlayable> resources of an APK.

Options:
 -h                                                Displays this help menu

 

aapt2使用 dump 命令指定以下子命令之一:

aapt2 dump resources output.apk

子命令 说明
apc 输出在编译期间生成的 AAPT2 容器(APC)的内容。
badging 输出从 APK 的清单中提取的信息。
configurations 输出 APK 中的资源使用的每项配置。
overlayable 输出 APK 的可叠加资源。
packagename 输出 APK 的软件包名称。
permissions 输出从 APK 的清单提取的权限。
strings 输出 APK 的资源表字符串池的内容。
styleparents 输出 APK 中使用的样式的父项。
resources 输出 APK 的资源表的内容。
xmlstrings 输出 APK 的已编译 XML 中的字符串。
xmltree 输出 APK 的已编译 XML 树。

 

 

Android Studio

https://developer.android.google.cn/studio?hl=zh-cn  Android Studio 滑到页面最下面,进行下载

 

当前最新版工具V3.3.2.0

posted @ 2019-04-16 09:10  行走的思想  阅读(6442)  评论(0)    收藏  举报