朋友要查看一個已存在包的versionCode信息,在群里面詢問,由于是已經存在的apk包,并且只需要其中的versionCode信息,筆者就給發了一段aapt命令:aapt dump badging <files.apk> 下面針對aapt 命令做一下介紹,之前筆者也對一些常用adb命令也做過介紹:總結一些常用Android adb 命令,了解這些命令以后,可以更方便我們開發,提高開發效率。在這筆者在網上隨便下載了一個app作為演示用。
aapt d[ump] [--values] WHAT file.{apk} [asset [asset ...]]
badging
Print the label and icon for the app declared in APK.打印APK中聲明的應用程序的標簽和圖標。

permissions
Print the permissions from the APK.打印APK中聲明的權限信息

**resources **
Print the resource table from the APK.打印APK中的資源表

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

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

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

List contents of Zip-compatible archive.列出壓縮文件目錄
aapt list <file.apk>

aapt list -v <file.apk>
會以table的形式輸出目錄

aapt list -a <file.apk>
詳細輸出所有目錄的內容(= aapt list)
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.
新聞熱點
疑難解答