org.gradle.jvmargs=-Xmx2048m
org.gradle.daemon=trueorg.gradle.parallel=true
編譯速度由
rebuild:Total time: 1 mins 3.007 secs
執行APP:Total time: 5 mins 36.478 secs
降低為
rebuild:Total time: 32.134 secs
執行APP:Total time: 1 mins 1.383 secs我發現-Xmx2048m並不是越高越好,像我調整為3072速度並沒有2048來得快,不知道為什麼。
參考資料
https://plus.google.com/+AndroidDevelopers/posts/bASZVRvdXnT
https://www.timroes.de/2013/09/12/speed-up-gradle/
http://alphayang.community/2015/10/16/speed-up-android-studio-build/
http://www.viralandroid.com/2015/08/how-to-make-android-studio-fast.html