加速 Android Studio 构建 [英] Speed-up Android Studio Builds

查看:28
本文介绍了加速 Android Studio 构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

也许是一个已知问题,但正在寻找加快 Android Studio 构建速度的方法.我的大约 20-25 秒,并不可怕,但在尝试测试增量更改时有点麻烦.

Perhaps a known question, but looking for ways to speed up Android Studio builds. Mine are about 20-25 sec, not terrible, but somewhat a nuisance when trying to test incremental changes.

显然,获得更快的 CPU 会有所帮助,但如果有的话,请寻找 Android Studio 的软件级别调整/提示.

Obviously getting a faster CPU would help, but looking for software level tweaks / tips to Android Studio if there are any.

谢谢.

推荐答案

我能够将构建时间减少到 3-5 秒.

I was able to reduce build times to 3-5 seconds.

  • 分配更多供 Android Studio & 使用的 RAM摇篮
  • 配置编译以并行运行
  • 按需编译

在我看来,RAM 设置是绝对必须的——在给它 2GB(我有 24GB 有足够的空间)之后,UI 又快又活泼&代码编辑非常快,完全没有延迟.

RAM settings are an absolute MUST in my opinion - after giving it 2GB (I have 24GB with plenty to spare) the UI is fast and snappy & code editing is very fast, no lag at all.

这是我使用的完整指令列表:

Here is the full list of instructions I used:

Android Studio RAM 设置:https://extremegtx.wordpress.com/2015/01/08/android-studio-speed-up-studio-and-gradle/

Android Studio RAM Settings: https://extremegtx.wordpress.com/2015/01/08/android-studio-speed-up-studio-and-gradle/

说明适用于 Windows,如果您使用的是 MAC,请改用以下路径:~/Library/Preferences/{FOLDER_NAME}/studio.vmoptions

Instructions are for Windows, if you're on MAC use the following path instead: ~/Library/Preferences/{FOLDER_NAME}/studio.vmoptions

Gradle 设置:http://jimulabs.com/2014/10/speeding-gradle-builds/

作为参考,我正在运行超频至强 X5650 @ 3.85GHz 并编译一个包含大量库和依赖项的相当大的项目.

For reference I am running an overclocked Xeon X5650 @ 3.85GHz and compiling a pretty big project with lots of libraries and dependencies.

这篇关于加速 Android Studio 构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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