在 IntelliJ IDEA 中加快 Android 项目构建时间 [英] Speed up Android project build time in IntelliJ IDEA

查看:46
本文介绍了在 IntelliJ IDEA 中加快 Android 项目构建时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道,如果有任何方法,如何像在 Eclipse 和 ADT 中一样在 IntelliJ IDEA 中设置 skip Packaging and dexing.IntelliJ Preferences 的 Android DX Compiler 部分有 Additional VM Options 字段,也许这可能是一种方法,如何设置它.我还要感谢另一个技巧,如何加快 IntelliJ Android 项目构建.

解决方案

在 Eclipse 首选项中,您所指的 skip Packaging and dexing 的完整名称是 Skip Packaging and dexing until export or发射.(加快文件保存时的自动构建),这是自 ADT 12 以来添加的一项功能,旨在解决 Eclipse 增量编译问题(这会减慢 Eclipse 上的开发速度),请查看 默认情况下,换句话说,它不会在文件更改时自动编译您的项目.所以这真的不是 IntelliJ 中的问题或功能.

您的构建过程瓶颈可能来自其他地方.AFAIK 在一个中型项目中,构建过程花费的最多时间是编译资源(AAPT 命令,查看 构建流程图).一些来自 xdadevelopers 的聪明人发现了瓶颈并创建了 AAPT 的修复版本:

http://forum.xda-developers.com/showthread.php?t=1907281

我自己使用它,我会说在 Eclipse 中可以感觉到速度提升,请注意它仅提升 AAPT 步骤,而不是打包广告.如果您使用 InteliJ,它可能没有太大帮助,因为它不需要经常编译项目.

I am wondering, if there is any way, how to set skip packaging and dexing in IntelliJ IDEA like in Eclipse and ADT. There is Additional VM Options field in Android DX Compiler section in IntelliJ Preferences, maybe this could be a way, how to set it. I would also appreciate another tips, how to speed up IntelliJ Android project build.

解决方案

In Eclipse preferences, the complete name of skip packaging and dexing you are referring is Skip packaging and dexing until export or launch. (Speeds up automatic builds on file save), which is a feature added since ADT 12 in orde to address Eclipse incremental compilation problem (which slow down development on Eclipse), check out the Revisions 12.0.0 (July 2011) and this link for more details, Note that packaging and dexing are fundamental step when you are debugging/running project regardless of which IDE (or non) you use.

As CrazyCoder mentioned in his comments, IntelliJ doesn't support Eclipse-like incremental compilation and Problems pane by default, in another word, it doesn't auto compile your project when file changed. So this is really not an issue nor feature in IntelliJ.

Your build process bottleneck probably comes from other place. AFAIK in a medium-sized project, the most time build process spend on is compiling resources (AAPT command, check out build process diagram). Some smart people from xdadevelopers found the bottleneck and create a fix version of AAPT:

http://forum.xda-developers.com/showthread.php?t=1907281

I use it myself and I would say the speed boost is feelable in Eclipse, note that it only boost the AAPT step, not packaging ad dexing. If you use InteliJ, it probably doesn't help much as it needn't compile the project quite often.

这篇关于在 IntelliJ IDEA 中加快 Android 项目构建时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆