41.Android aapt工具

本文介绍了Android Asset Packaging Tool(aapt),它是Android SDK的一部分,用于查看、创建和更新ZIP格式的档案。aapt可以编译资源并用于打包apk文件。文章详细讲解了aapt的环境配置、命令用法,包括`list`、`dump`、`package`等,并给出了具体的使用示例。
摘要由CSDN通过智能技术生成

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

aapt 为 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,以下是我配置:<

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值