Appt Usage Summary

Source: Internet
Author: User

AAPT Command Summary


AAPT is the Android Asset Packaging tool. This article summarizes the use of the tools.


1. AAPT L[ist] [-v] [-a] file. {zip,jar,apk}
List contents of zip-compatible archive.
1.1 List Compressed Files directory
AAPT L <file_path.apk>
Parameters:
-V: The directory is output as table, table with: Length, Method, Size, Ratio, Date, Time, CRC-32, Name.
Wherein method is compressed, there are: deflate and stored two kinds, that is, the zip directory used by the compression mode or storage mode, you can see RESOURCES.ARSC, *.png using compression mode, while others adopt compression mode.
The ratio represents the compression rate. CRC-32 not clear its meaning, Sodino hope to advise.

-A: The contents of all directories are printed in detail.
: Aapt_list. Jpg



2. 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.

2.1 View APK package PackageName, Versioncode, Applicationlabel, launcheractivity, permission and other details
AAPT dump badging <file_path.apk>
: Aapt_dump_badging. Jpg


2.2 Viewing permissions
AAPT Dump Permissions <file_path.apk>
: Aapt_dump_permissions. Jpg



2.3 View a list of resources
AAPT Dump Resources <file_path.apk>
Usually output a lot of information, if you want to view all, please use the following two sentences:
AAPT Dump Resources <file_path.apk> > Sodino.txt
Sodino.txt
This will output all the information through the redirect > to the Sodino.txt file, and then open the file for viewing.


2.4 Viewing APK configuration information
AAPT Dump Configurations <file_path.apk>


2.5 View the specified XML file for the specified apk.
AAPT Dump Xmltree <file_path.apk> res/***.xml
XML information that is exported as a tree structure.
AAPT Dump Xmlstrings <file_path.apk> res/***.xml
Prints all the string information in the XML file.
: Aapt_dump_xmltree. Jpg

3
Because of the large amount of code here, I write a batch form.

Generate R.java using AAPT
The Gen folder must be in the engineering catalog of the REM test, otherwise it will prompt: Unable to open class file r.java:no such file or directory
%aapt% package-f-m-j%gen%-S%res%-i%android_jar%-M%android_manifest_xml%

To generate a resource bundle file using AAPT
%aapt% package-f-M%android_manifest_xml%-s%res%-A%assets%-I%android_jar%-f%resource%

%gen%: The R.java folder path that is stored.
%res%:res folder path.
%android_jar%: The referenced android.jar path.
%android_manifest_xml%: Engineering androidmanifest.xml Absolute path.
%assets%:asset folder path.
%resource%: The generated RESOUCES.ARSC storage path.

Reference:
Android series of Android command line manual compilation packaging detailed
http://blog168.chinaunix.net/space.php?uid=22957718&do=blog&cuid=2322671



The rest is not explained, see directly:
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.
: aapt_r_a_v.jpg

This article belongs to CSDN Blog blogger Sodino all
Reprint Please specify the Source: http://blog.csdn.net/sodino/archive/2011/01/07/6122665.aspx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.