Android Studio Gradle构建速度优化

create a file named gradle.properties in the following directory:

  • /home/<username>/.gradle/ (Linux)
  • /Users/<username>/.gradle/ (Mac)
  • C:\Users\<username>.gradle (Windows)
    Add this line to the file:
org.gradle.daemon=true

From now on Gradle will use a daemon to build, whether you are using Gradle from command line or building in Android Studio. You could also place the gradle.properties file to the root directory of your project and commit it to your SCM system. But you would have to do this, for every project (if you want to use the daemon in every project).

关于这个写法有几个变种,都尝试了一下,并没有用。

参考Android Studio配置选项

Android Studio 1.1.0+版本中该配置已经默认打开。


2.
用命令行Build

可以参考这个讨论串
https://plus.google.com/u/0/+RicardoAmaral/posts/e9PG6vSN5w3

gradle assembleDebug
实测速度快50%左右 原理不明
回头写个脚本 build完成再自动安装运行应该就好了

更新下

gradle installDebug 就可以了,不用自己在gradle里搞task了,省事.
明天测试下性能


3.
Android模块化编程之引用本地的aar
http://stormzhang.com/android/2015/03/01/android-reference-local-aar/

目前把项目中引用的Library都打成了本地aar,减少编译的文件,编译速度显著加快


4.
我觉得TMD还是把公司的破电脑扔了换个新的才能从根本上解决问题

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值