Android aapt命令介绍及常用命令实践


声明:本文转载自https://my.oschina.net/u/1433837/blog/1605289,转载目的在于传递更多信息,仅供学习交流之用。如有侵权行为,请联系我,我会及时删除。

###引言

  • 朋友要查看一个已存在包的versionCode信息,在群里面询问,由于是已经存在的apk包,并且只需要其中的versionCode信息,笔者就给发了一段aapt命令:aapt dump badging <files.apk> 下面针对aapt 命令做一下介绍,之前笔者也对一些常用adb命令也做过介绍:总结一些常用Android adb 命令,了解这些命令以后,可以更方便我们开发,提高开发效率。在这笔者在网上随便下载了一个app作为演示用。

###aapt 命令大全

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

  • badging

    Print the label and icon for the app declared in APK. 打印APK中声明的应用程序的标签和图标。

    aapt dump badging

  • permissions

    Print the permissions from the APK. 打印APK中声明的权限信息

    aapt dump permissions

  • **resources **

    Print the resource table from the APK. 打印APK中的资源表

    aapt dump resources

  • configurations

    Print the configurations in the APK. 打印APK中的配置信息

    aapt dump configurations

  • xmltree

    Print the compiled xmls in the given assets. 打印指定apk的指定xml文件。

    aapt dump configurations

  • xmlstrings

    Print the strings of the given compiled xml assets. 打印xml文件中所有的字符串信息

    aapt dump xmlstrings

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

List contents of Zip-compatible archive. 列出压缩文件目录

  • aapt list <file.apk>

    aapt list

  • aapt list -v <file.apk>

    会以table的形式输出目录

    aapt list -v

  • aapt list -a <file.apk>

    详细输出所有目录的内容(= aapt list)

####其他aapt 命令(不常用,不做演示,有兴趣可以自己试一下)

  • aapt r[emove] [-v] file.{zip,jar,apk} file1 [file2 ...]

    Delete specified files from Zip-compatible archive.

  • aapt a[dd] [-v] file.{zip,jar,apk} file1 [file2 ...]

    Add specified files to Zip-compatible archive.

  • aapt v[ersion]

    Print program version.

本文发表于2018年01月11日 10:32
(c)注:本文转载自https://my.oschina.net/u/1433837/blog/1605289,转载目的在于传递更多信息,并不代表本网赞同其观点和对其真实性负责。如有侵权行为,请联系我们,我们会及时删除.

阅读 1763 讨论 0 喜欢 0

抢先体验

扫码体验
趣味小程序
文字表情生成器

闪念胶囊

你要过得好哇,这样我才能恨你啊,你要是过得不好,我都不知道该恨你还是拥抱你啊。

直抵黄龙府,与诸君痛饮尔。

那时陪伴我的人啊,你们如今在何方。

不出意外的话,我们再也不会见了,祝你前程似锦。

这世界真好,吃野东西也要留出这条命来看看

快捷链接
网站地图
提交友链
Copyright © 2016 - 2021 Cion.
All Rights Reserved.
京ICP备2021004668号-1