Kwandroid
The kwandroid command allows you to obtain the build specification file for an Android project (versions 10, 11, 12, 13, 14).
To generate a build specification for Android 9 or previous versions, run the following bash script:
#!/bin/bash source build/envsetup.sh lunch aosp_arm-eng kwinject -o kwinject.out make
Usage
kwandroid --android-version <version> --output <output_file> --android <dir> --script <script_file> [optional arguments]
- <version> specifies the version of Android (For example: 10, 11, 12, 13, or 14)
- <output_file> specifies the name of the build specification file that is created
- <dir> is the location of your Android working directory
- <script_file> is the bash script used to run the Android build. For example:
#!/bin/bash source build/envsetup.sh lunch aosp_arm-eng m
- [optional arguments] are any additional options you may want to specify. See the 'Optional arguments' section below for more details.
kwandroid runs the Android build as defined in the specified <script_file>. It captures the build specification for java and stores it in the specified <output_file>. For example, you can use the following command to capture the build specification for an Android 11 project:
$<kw-intallation-dir>/bin/kwandroid --android-version 11 --output /tmp/kwinject.out --android /space/android-r --script /space/android-r-build.sh
The command above runs compilation for an Android-R project (android working directory is /space/android-r). The compilation command is defined in the /space/android-r-build.sh script file and the generated build specification is stored in the /tmp/kwinject.out file.
Options
Name (and short name) | Description |
---|---|
--android-version <version> | to specify the version of Android |
--android <dir> | location of your android working directory |
--bazel | supports analysis of Android Bazel builds |
--output <file> | the build specification <file> to create |
--script <file> | bash script to run Android build |
Optional arguments
Name (and short name) | Description |
---|---|
--trace-out <file> | specify the trace file to create (default is 'trace.out') |
--config <file> (-c) | read filter configuration from a file (default is KW-HOME/config/kwfilter.conf) |
--no-config | do not read filter configuration from config file |
--no-resolve | do no resolve symbolic links |
--prog PROG[=FILTER][,PROG[=FILTER]...] (-P) | intercept execution of command PROG; use FILTER to handle options/arguments |
--ignore-files PATTERN[,PATTERN...] (-I) | ignore source files matching one of the specified PATTERNs |
--white-dir <directory> | allow input files from the specified directory, even if it is temporary |
--exclude-prog PATTERN[,PATTERN...] | do not handle programs matching one of the specified PATTERNs |
--exclude-description PATTERN[,PATTERN...] | do not handle a program if the description matches one of the specified PATTERNs |
--cache-files PATTERN[,PATTERN...] (-C) | save source files matching one of the specified PATTERNs; if any of these files is deleted during a build, it is restored |
--cache-dir <directory> | use specified cache directory to save source files (default is current working directory) |
--variable VARIABLE=STRING (-V) | replace every occurrence of STRING in the output file with reference to VARIABLE |
-f <file> | read variables from the specified file |
--lang LANGUAGE | specify the language option to generate separate build specifications for C/C++ (cxx) and Java (java). Not declaring --lang assumes the default behavior, which traces both C/C++ and Java. |