1
.\" Hey, EMACS: -*- nroff -*-
2
.TH aapt 1 "October 15, 2014"
3
.\" Please adjust this date whenever revising the manpage.
5
.\" Some roff macros, for reference:
6
.\" .nh disable hyphenation
7
.\" .hy enable hyphenation
9
.\" .ad b justify to both left and right margins
10
.\" .nf disable filling
11
.\" .fi enable filling
12
.\" .br insert line break
13
.\" .sp <n> insert n+1 empty lines
14
.\" for manpage-specific macros, see man(7)
16
aapt \- Android Asset Packaging Tool
19
.RI command\ [\ options\ ]\ files\ ...
23
.RI l[ist]\ [\-v]\ [\-a]\ file.{zip,jar,apk}
25
List contents of Zip-compatible archive.
29
.RI d[ump] [\-\-values] WHAT file.{apk} [asset [asset ...]]
31
strings Print the contents of the resource table string pool in the APK.
32
badging Print the label and icon for the app declared in APK.
33
permissions Print the permissions from the APK.
34
resources Print the resource table from the APK.
35
configurations Print the configurations in the APK.
36
xmltree Print the compiled xmls in the given assets.
37
xmlstrings Print the strings of the given compiled xml assets.
40
.RI p[ackage]\ [\-d]\ [\-f]\ [\-m]\ [\-u]\ [\-v]\ [\-x]\ [\-z]\ [\-M\ AndroidManifest.xml]
42
[\-0 extension [\-0 extension ...]] [\-g tolerance] [\-j jarfile]
43
[\-\-debug-mode] [\-\-min-sdk-version VAL] [\-\-target-sdk-version VAL]
44
[\-\-app-version VAL] [\-\-app-version-name TEXT] [\-\-custom-package VAL]
45
[\-\-rename-manifest-package PACKAGE]
46
[\-\-rename-instrumentation-target-package PACKAGE]
47
[\-\-utf16] [\-\-auto-add-overlay]
48
[\-\-max-res-version VAL]
49
[\-I base-package [\-I base-package ...]]
50
[\-A asset-source-dir] [\-G class-list-file] [\-P public-definitions-file]
51
[\-S resource-sources [\-S resource-sources ...]]
52
[\-F apk-file] [\-J R-file-dir]
53
[\-\-product product1,product2,...]
54
[\-c CONFIGS] [\-\-preferred-configurations CONFIGS]
55
[raw-files-dir [raw-files-dir] ...]
56
[\-\-output-text-symbols DIR]
58
Package the android resources. It will read assets and resources that are
59
supplied with the \-M \-A \-S or raw-files-dir arguments. The \-J \-P \-F and \-R
60
options control which files are output.
63
.RI r[emove]\ [\-v]\ file.{zip,jar,apk}\ file1\ [file2\ ...]
64
Delete specified files from Zip-compatible archive.
67
.RI a[dd]\ [\-v]\ file.{zip,jar,apk}\ file1\ [file2\ ...]
68
Add specified files to Zip-compatible archive.
71
.RI c[runch]\ [\-v]\ \-S\ resource-sources\ ...\ \-C\ output-folder\ ...
72
Do PNG preprocessing on one or several resource folders
73
and store the results in the output folder.
76
.RI s[ingleCrunch]\ [\-v]\ \-i\ input-file\ \-o\ outputfile
77
Do PNG preprocessing on a single file.
81
Print program version.
84
The Android Asset Packaging Tool (aapt) takes your application resource files,
85
such as the AndroidManifest.xml file and the XML files for your Activities,
86
and compiles them. An R.java is also produced so you can reference your
87
resources from your Java code.
91
A summary of options is included below.
94
print Android-specific data (resources, manifest) when listing
97
specify which configurations to include. The default is all
98
configurations. The value of the parameter should be a comma
99
separated list of configuration values. Locales should be specified
100
as either a language or language-region pair. Some examples:
105
If you put the special locale, zz_ZZ on the list, it will perform
106
pseudolocalization on the default locale, modifying all of the
107
strings so you can look for strings that missed the
108
internationalization process. For example:
112
one or more device assets to include, separated by commas
115
force overwrite of existing files
118
specify a pixel tolerance to force images to grayscale, default 0
121
specify a jar or zip file containing classes to include
124
junk path of file(s) added
127
make package directories under location specified by \-J
130
update existing packages (add new, replace older, remove deleted files)
136
create extending (non-application) resource IDs
139
require localization of resource attributes marked with
140
localization="suggested"
143
additional directory in which to find raw asset files
146
A file to output proguard options into.
149
specify the apk file to output
152
add an existing package to base include set
155
specify where to output R.java resource constant definitions
158
specify full path to AndroidManifest.xml to include in zip
161
specify where to output public resource definitions
164
directory in which to find resources. Multiple directories will be scanned
165
and the first match found (left to right) will take precedence.
168
specifies an additional extension for which such files will not
169
be stored compressed in the .apk. An empty string means to not
170
compress any files at all.
173
inserts android:debuggable="true" in to the application node of the
174
manifest, making the application debuggable even on production devices.
176
.B \-\-min-sdk-version
177
inserts android:minSdkVersion in to manifest. If the version is 7 or
178
higher, the default encoding for resources will be in UTF-8.
180
.B \-\-target-sdk-version
181
inserts android:targetSdkVersion in to manifest.
183
.B \-\-max-res-version
184
ignores versioned resource directories above the given value.
187
when used with "dump resources" also includes resource values.
190
inserts android:versionCode in to manifest.
193
inserts android:versionName in to manifest.
195
.B \-\-custom-package
196
generates R.java into a different package.
198
.B \-\-extra-packages
199
generate R.java for libraries. Separate libraries with ':'.
201
.B \-\-generate-dependencies
202
generate dependency files in the same directories for R.java and resource package
204
.B \-\-auto-add-overlay
205
Automatically add resources that are only in overlays.
207
.B \-\-preferred-configurations
208
Like the \-c option for filtering out unneeded configurations, but
209
only expresses a preference. If there is no resource available with
210
the preferred configuration then it will not be stripped.
212
.B \-\-rename-manifest-package
213
Rewrite the manifest so that its package name is the package name
214
given here. Relative class names (for example .Foo) will be
215
changed to absolute names with the old package so that the code
216
does not need to change.
218
.B \-\-rename-instrumentation-target-package
219
Rewrite the manifest so that all of its instrumentation
220
components target the given package. Useful when used in
221
conjunction with \-\-rename-manifest-package to fix tests against
222
a package that has been renamed.
225
Specifies which variant to choose for strings that have
229
changes default encoding for resources to UTF-16. Only useful when API
230
level is set to 7 or higher where the default encoding is UTF-8.
232
.B \-\-non-constant-id
233
Make the resources ID non constant. This is required to make an R java class
234
that does not contain the final value but is used to make reusable compiled
235
libraries that need to access resources.
237
.B \-\-error-on-failed-insert
238
Forces aapt to return an error if it fails to insert values into the manifest
239
with \-\-debug-mode, \-\-min-sdk-version, \-\-target-sdk-version \-\-version-code
240
and \-\-version-name.
241
Insertion typically fails if the manifest already defines the attribute.
243
.B \-\-output-text-symbols
244
Generates a text file containing the resource symbols of the R class in the
248
Assets to be ignored.
250
aapt was written by The Android Open Source Project.