Appium windows 使用 sdk 自带打包工具获取包名,系统权限,资源列表,配置

careysucci · July 03, 2014 · 996 hits
本帖已被设为精华帖!

感谢 xingzunxi 提供的知识点,由小菜详细补充为适合新手操作的讲解。

准备工作:1、aapt 工具 2、aapt 命令使用方法

aapt 工具:在 sdk 目录下可以找到,也就是 adt 目录下找 sdk 目录,截图路径:

2、aapt 基础知识装备:
什么是 aapt?

  执行命令: C:\Users\Xiaopeng>aapt

  Android Asset Packaging Tool

  1. 列出 apk 包的内容

  aapt l[ist] [-v] [-a] file.{zip,jar,apk}

  注:filepath 是 apk 存放的路径

  1.1 aapt l -v filepath/..apk  :以 table 的形式列出来 (不过我用起来老是出,win7 和 xp 都一样,大家可以试一下)

  1.2 aapt l -a filepath/..apk : 详细的列出 apk 的内容

  由于内容太多,我们把内容都存放到 txt 文件里,打开查看

  1.3 aapt l filepath/..apk : 查看 apk 内容

  由于内容太多,我们把内容都存放到 txt 文件里,打开查看

  对比一下可以看出, aapt l -a filepath/..apk 显示的 apk 内容更详细

  2. 查看 apk 的一些信息

  aapt d[ump] [--values] WHAT file.{apk} [asset [asset ...]]

  badging Print the label and icon for the app declared in APK.

  permissions Print the permissions from the APK.

  resources Print the resource table from the APK.

  configurations Print the configurations in the APK.

  xmltree Print the compiled xmls in the given assets.

  xmlstrings Print the strings of the given compiled xml assets.

  aapt d badging filepath/..apk :显示标签、图标和应用程序的相关描述。 (这个命令很有用啊,我写过一个自动化更新下载的程序,就用到这个命令来校验应用的包名、版本和权限)

  aapt d permissions filepath/..apk :显示 apk 所具有的系统权限

  aapt d badging filepath/..apk : 显示 apk 的资源列表 (很多内容,如果想看最好还是转到 txt 里面查看吧)

  aapt d configurations filepath/..apk : 显示 apk 的配置信息

  aapt d xmltree filepath/..apk xmlname : 以树型显示 apk 中某个 xml 文件

  例:以树型显示 QQapk 中 AndroidManifest.xml 文件

  aapt d xmlstrings filepath/..apk xmlname : 显示 apk 中某个 xml 文件中所有的字符

  例:显示 QQapk 中 AndroidManifest.xml 中的字符

  

aapt 知识点转载:http://www.ltesting.net

No Reply at the moment.
需要 Sign In 后方可回复, 如果你还没有账号请点击这里 Sign Up