上个星期就放出了Android studio出2.0的消息,看了一下what's new 简直抓到了那个蛋疼的编译速度痛点.在网上稍微搜索了一下后发现基本都是介绍视频.一番挣扎后(因为被这IDE坑过几次),于是决定自己当一回小白鼠实验一下.

instant run

准备

首先,是把升级跳到最不稳定的频道,check 一下然后 update and restart,这不必说.唯一值得讲的一点在于,下完安装的时候会耗尽磁盘的资源,很卡.然后第一次打开的时候记得导入之前的设置.

床说中的瞬间执行

instant run需要gradle 2.8+好在ide认识到这一点,点自动更新工程,等待结果完成即可.

更新之后,会发现gradle用上了2.8.然后下面的设置也不再是灰色.表明设置可用.我建议只勾选第一项

此外,应用instant run的AVD需要api14+

不足

但是目前,该功能还是有些不完善的.这里引用原文

Here are some code changes that Instant Run does not currently support:

  • Add/remove/change annotations

  • Add/remove/change an instance field

  • Add/remove/change a static field

  • Add/remove a static method signature

  • Change a static method signature

  • Add/remove an instance method

  • Change an instance method signature

  • Changing which parent class the current class inherits from

  • Change the list of implemented interfaces

  • Changing static initializer of a class

使用和体会

代码改动之后,点击run(此时的run左边有个小闪电的图标),之后即可完成迅速编译.我这边试了一下,大概2s以内.

11:23:46 Executing tasks: [:app:incrementalDebugSupportDex]
11:23:48 Gradle build finished in 1s 948ms
11:23:48 Instant Run: Instant Run applied code changes.
You can restart the current activity by clicking here or pressing Ctrl+Shift+R anytime.
You can also configure restarts to happen automatically. (Dismiss, Dismiss All)

还是比较快的~

至于GPU Profiler,暂时用不到,就不作说明了

这玩意大概就是用来 预览和跟踪渲染效果的吧,具体的指导可以看第三个链接.

此外,编辑器的一些细节(窗体的大小,etc)有些许的变化,这个就自己慢慢体会了.

总结

总的来说instant run只是加速了项目的构建,这就是本来应该做的事情嘛~惊喜不是很多,我期待的是更快的AVD,但是目前还看不到相关消息.

微软最近也出了AVD,但是正当我激动之时,发现这玩意要hyper-v.也就是专业版win8.1/10才有,而当初8.1升级过来全特么变成家庭版,心凉了一截.

参考链接:

Android studio 2.0下载链接

https://sites.google.com/a/android.com/tools/tech-docs/instant-run%20

https://sites.google.com/a/android.com/tools/tech-docs/gpu-profiler%20

当一回Android Studio 2.0的小白鼠的更多相关文章

  1. Android Studio 3.0正式版填坑之路

    原文:https://www.jianshu.com/p/9b25087a5d7d   Android Studio 3.0启动图 序言 总看别人的文章,今天尝试着自己来写一篇.在逛论坛时候,无意间发 ...

  2. Android Studio 3.0 下载 使用新功能介绍

    谷歌2017发布会更新了挺多内容的,而且也发布了AndroidStudio3.0预览版,一些功能先睹为快.(英语一般,有些翻译不太好) 下载地址 https://developer.android.g ...

  3. Android Studio 2.0使用指南

    一.下载界面.[无激活码 无序列码 无毒请放心使用][需将JAVA程序升级到1.8] 网址:http://www.android-studio.org/index.php/download/andro ...

  4. Android Studio 1.0.2项目实战——从一个APP的开发过程认识Android Studio

    Android Studio 1.0.1刚刚发布不久,谷歌紧接着发布了Android Studio 1.0.2版本,和1.0.0一样,是一个Bug修复版本.在上一篇Android Studio 1.0 ...

  5. Android Studio 1.0.1 + Genymotion安卓模拟器打造高效安卓开发环境

    我们开发安卓大多是使用Eclipse和安卓SDK中自带的安卓模拟器.当然,Google早就推出了自己的安卓开发环境——Android studio,在不久前,Google发布了Android Stud ...

  6. [Android] 环境配置之正式版Android Studio 1.0

    昨天看见 Android Studio 1.0 正式版本发布了:心里挺高兴的. 算是忠实用户了吧,从去年开发者大会一开始出现 AS 后就开始使用了:也是从那时开始就基本没有用过 Eclipse 了:一 ...

  7. [Android] android studio 2.0即时运行功能探秘

    即时运行instant Run是android studio 2中,开发人员最关心的特性之一 在google发布studio 2.0之后,马上更新体验了一把,然而发现,并没快多少,说好的即时运行呢? ...

  8. Windows环境下Android Studio v1.0安装教程

    Windows环境下Android Studio v1.0安装教程 准备工具 JDK安装包. 要求:JDK 7以及以上版本. Android Studio安装文件. Windows: exe(包含SD ...

  9. 告别编译运行 ---- Android Studio 2.0 Preview发布Instant Run功能

    以往的Android开发有一个头疼的且拖慢速度的问题,就是你每改一行代码要想看到结果必须要编译运行到手机或者模拟器上,而且需要从头(可能是登录界面)一直点击到你修改的界面为止.开发一个完整的Andro ...

随机推荐

  1. linux 多个文件中查找字符串

    2015年2月9日 14:36:38 # find <directory> -type f -name "*.c" | xargs grep "<str ...

  2. 【JAVA、C++】LeetCode 003 Longest Substring Without Repeating Characters

    Given a string, find the length of the longest substring without repeating characters. For example, ...

  3. 【JAVA、C++】LeetCode 015 3Sum

    Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all un ...

  4. 使用Memory Analyzer tool(MAT)分析内存泄漏(一)

    转载自:http://www.blogjava.net/rosen/archive/2010/05/21/321575.html 前言 在平时工作过程中,有时会遇到OutOfMemoryError,我 ...

  5. fedora 添加其他操作系统到 GRUB 2 菜单

    # yum install os-prober # grub2-mkconfig -o /boot/grub2/grub.cfg

  6. Android之Tab类总结

    本文主要包括以下Tab类实现方式 FragmentTabHost+Fragment实现 传统的ViewPager实现 FragmentManager+Fragment实现 ViewPager+Frag ...

  7. Zookeeper笔记(四)Zookeeper在Dubbo中的应用

    Zookeeper在Dubbo中的应用 Dubbo的架构 节点角色说明: Provider: 暴露服务的服务提供方.Consumer: 调用远程服务的服务消费方.Registry: 服务注册与发现的注 ...

  8. wp8 入门到精通 线程

    Dispatcher.BeginInvoke(() => MessageBox.Show(String.Format("A push notification {0} error oc ...

  9. php中base64_decode与base64_encode加密解密函数

    php中base64_decode与base64_encode加密解密函数,实例分析了base64加密解密函数的具体用法,具有一定的实用价值,需要的朋友可以参考下 本文实例讲述了php中base64_ ...

  10. PHP 常用正则汇总

     平时做网站经常要用正则表达式,下面是一些讲解和例子,仅供大家参考和修改使用:    }|d{})-((([-]{}))|([|]))-(([-]([-]{}))|([|]))$/   ([-]{}) ...