41.Android aapt工具
aapt 介绍
可参考官方文档: http://www.androidcn.net/wiki/index.php/Reference/aapt
aapt stands for Android Asset Packaging Tool and is included in the tools/ directory of the SDK. This tool allows you to view, create, and update Zip-compatible archives (zip, jar, apk). It can also compile resources into binary assets.
Though you probably won’t often use aapt directly, build scripts and IDE plugins can utilize this tool to package the apk file that constitutes an Android application.
For more usage details, open a terminal, go to the tools/ directory, and run the command:
Linux or Mac OS X:
./aapt
Windows:
aapt.exeaapt 为 Android Asset Packaging Tool , 在SDK的tools/目录下. 该工具可以查看, 创建, 更新ZIP格式的文档附件(zip, jar, apk). 也可将资源文件编译成二进制文件。
尽管你可能没有直接使用过aapt工具, 但是build scripts和IDE插件会使用这个工具打包apk文件构成一个Android 应用程序.
获取更多的实用信息, 请打开终端控制台, 到tools/目录下, 执行命令:
Linux or Mac OS X:
./aapt
Windows:
aapt.exe
aapt 环境配置
aapt工具位于:sdk/buid-tools/android-[version]/aapt
。
Windows环境的话,可以直接在环境变量里配置一个PATH,指定到
sdk/buid-tools/android-[version]
即可。Mac环境的话,我用的是Oh My Zsh,所以直接
vi ~/.zshrc
,以下是我配置:<