What is aapt?
Run the following command: C: \ Users \ Xiaopeng> aapt.
Android asset packaging Tool
1. List the APK Package content aapt L [ist] [-V] [-A] file. {zip, jar, APK}
Note: filepath is the path where the APK is stored.
1.1 aapt L-V filepath/.apk:It is listed in table format (but I always use it. Windows 7 and XP are the same. You can try it)
1.2 aapt L-a filepath/.apk:List the APK content in detail
Because there is too much content, we store all the content in the TXT file, open and view
1.3 aapt l filepath/.apk:Because there are too many APK content, we store all the content in the TXT file.
By comparison, we can see that the APK content displayed by aapt L-a filepath/..apk is more detailed.
2. view some APK Information
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.
Deployments print the deployments 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: displays tags, icons, and application descriptions. (This command is very useful. I wrote a program that automates update and download, and used this command to verify the package name, version, and permission of the application.) aapt D permissions filepath/..apk: display the system permissions of the APK aapt D badging filepath/..apk: displays the list of APK resources (a lot of content, if you want to see it, you 'd better go to the TXT to view it)
Aapt D configurations filepath/.apk: displays the APK configuration information.
Aapt D xmltree filepath/.apk xmlname: displays an XML file in the APK in a tree.
For example, the androidmanifest. xml file in qqapk is displayed in a tree.
Aapt D xmlstrings filepath/.apk xmlname: Display All characters in an XML file in the APK
For example, display the characters in androidmanifest. XML in qqapk
3. Compile Android ResourcesAapt P [ackage] [-D] [-F] [-M] [-u] [-V] [-x] [-Z] [-M androidmanifest. XML] \
[-0 extension [-0 extension...] [-G tolerance] [-J jarfile] \
[-- Debug-mode] [-- Min-SDK-version Val] [-- target-SDK-version Val] \
[-- App-version Val] [-- app-version-Name text] [-- custom-package Val] \
[-- Rename-manifest-package] \
[-- Rename-Instrumentation-target-package] \
[-- UTF16] [-- auto-add-overlay] \
[-- Max-res-version Val] \
[-I base-package [-I base-package...] \
[-A asset-source-Dir] [-G class-list-file] [-P public-definitions-file] \
[-S resource-sources [-s resource-sources...] \
[-F apk-file] [-j r-file-Dir] \
[-- Product product1, product2,...] \
[-C configs] [-- preferred-configurations configs] \
[-O] \
[Raw-files-dir [raw-files-Dir]...] wow, a little more. Refer to the explanation given by others:-F if the compiled file already exists, forcibly overwrite-m to store the directory of the generated package in the directory specified by the-J parameter-J to specify the generated R. java output directory-s res folder path-A assert folder path-I android of a certain version of the platform. jar path-F specifies the output of the APK File
Instance:
1. compile the project resources into the R. Java FileAapt package-m-j <R. Java folder>-S <res path>-I <Android. Jar path>-M <androidmanifest. XML Path>
Instance:1. CMD -- locate the android source file directory, for example, cd e: \ wirelessqa \ Hi --- According to the command given above
<R. Java folder>: Gen \ com \ perf \
<Res path>:Res
<Android. Jar path>:
E: \ Software \ android-sdk-windows-1.6_r1 \ platforms \ Android-1.6 \ Android. jar this depends on your APK corresponding support Android version here there are a lot, find the corresponding
<Androidmanifest. XML Path>:Androidmanifest. xml
OK, run the following command:
Aapt p-F-m-J Gen \ com \ perf \-s res-I E: \ Software \ android-sdk-windows-1.6_r1 \ platforms \ Android-1.6 \ Android. jar-M androidmanifest. xml
2. compile the project resources into an APK packageAapt package-F-S <res path>-I <android. jar path>-A <assert path>-M <androidmanifest. XML Path>-F <output package directory + package name>
Instance:1. CMD -- locate the android source file directory, for example, cd e: \ wirelessqa \ Hi --- set it to <res path>: res <android. jar Path & gt;: e: \ Software \ android-sdk-windows-1.6_r1 \ platforms \ Android-1.6 \ android. jar <assert path>: Assets <androidmanifest. XML Path>: androidmanifest in the current directory. XML <output package directory + package name>: hi.apk under the current directory
OK, run the command: aapt p-F-s res-I E: \ Software \ android-sdk-windows-1.6_r1 \ platforms \ Android-1.6 \ android. jar-A Assets-M androidmanifest. XML-F hi.apk
4. Remove the files in the packaged APK.
Aapt R [emove] [-v] file. {zip, jar, APK} file1 [file2...]
Instance:Remove an object from the APK.Command: Aapt r <path of your APK File> <file name to be removed> first remove androidmanifest. xml file from hi.apk, and then try to display the file. The result cannot be found, proving that the file has been removed successfully. 5. Add the file to the packaged APK.
Aapt A [DD] [-v] file. {zip, jar, APK} file1 [file2...]Instance:Add the file to the packaged APK FileCommand:Aapt A <path of your APK File> <path of the file to be added> here I encountered a problem. After the file is successfully added, I tried to display the file. The result showed that the file was damaged, I still don't know what the problem is. If anyone knows, let me know.
6. PNG file preprocessing
Aapt C [runch] [-v]-s resource-sources...-C output-folder... pre-processes PNG files and stores the results in a folder.
Instance: aapt C-S<Res path>
-C <path of the folder to be stored>
Result:
7. display the aapt versionAapt V [ersion]