(4.6.11.2)Android LayoutCast 初探
2016-04-26 18:31
706 查看
今天无意间看见了一个神器,顿时让我血气蓬勃! 废话不多说,先上网址:https://github.com/mmin18/LayoutCast
把代码和资源文件的改动直接同步到手机上,应用不需要重启。省去了编译运行漫长的等待,比较适合真机调试的时候使用。
先看看视频:
优酷: http://v.youku.com/v_show/id_XMTMwNTUzOTQ3Mg
Here is how it compared to Gradle and Facebook Buck:
The test machine is a 2015 MBP with a 2014 MotoX.
The test project's apk is about 14.3MB, which contains 380k lines of java code and 86k lines of xml files.
Facebook Buck http://github.com/facebook/buck also build very fast. In some cases it's faster than
LayoutCast due to it's multi-process build.
The biggest problem is Buck requires you change a lot of code, and restruct your project in small modules. It's quiet painful to make it work on existing project, especially big ones. I tried to use Buck on the test project, which took me a week just to make
it run.
What I needs is a build tool that is easy to setup, fast as Buck, and provide a Run button in AndroidStudio. So I created LayoutCast.
LayoutCast only support Mac (for now) ; Cast Java code only support ART runtime (Android 5.0)
目前仅支持Mac系统及Android5.0系统
好了,看完之后是不是倍感兴奋呢,下面 博主带一波节奏:
主要事情说三遍: 需要Python环境 需要Python环境 需要Python环境
先下载:https://github.com/mmin18/LayoutCast/raw/master/ide/IDEAPlugin/IDEAPlugin.jar
然后打开AndroidStudio的Setting页面,选择Plugins ,Install plugin from disk...
安装完成后,会提示重启AndroidStudio来安装插件。
重启后,会发现
多了一个图标,这就是咱们LayoutCast的Run键了。
接下来,在你的项目下的build.gradle下添加
在AndroidManifest.xml里加入
然后直接Run项目在Android5.0手机系统下,项目在手机上跑起来后,就可以适时调整了啦~
每次修改代码后,点击
,手机端回黑屏,显示 Cast DEX in 2 second... 如图
电脑端则会显示
之后 新的代码就可以跑在手机上了,不需要重新编译App 安装App ,每次只需要1秒哟,速度与激情~
把代码和资源文件的改动直接同步到手机上,应用不需要重启。省去了编译运行漫长的等待,比较适合真机调试的时候使用。
先看看视频:
优酷: http://v.youku.com/v_show/id_XMTMwNTUzOTQ3Mg
Benchmark
Here is how it compared to Gradle and Facebook Buck:The test machine is a 2015 MBP with a 2014 MotoX.
The test project's apk is about 14.3MB, which contains 380k lines of java code and 86k lines of xml files.
About Facebook Buck
Facebook Buck http://github.com/facebook/buck also build very fast. In some cases it's faster thanLayoutCast due to it's multi-process build.
The biggest problem is Buck requires you change a lot of code, and restruct your project in small modules. It's quiet painful to make it work on existing project, especially big ones. I tried to use Buck on the test project, which took me a week just to make
it run.
What I needs is a build tool that is easy to setup, fast as Buck, and provide a Run button in AndroidStudio. So I created LayoutCast.
LayoutCast only support Mac (for now) ; Cast Java code only support ART runtime (Android 5.0)
目前仅支持Mac系统及Android5.0系统
好了,看完之后是不是倍感兴奋呢,下面 博主带一波节奏:
主要事情说三遍: 需要Python环境 需要Python环境 需要Python环境
先下载:https://github.com/mmin18/LayoutCast/raw/master/ide/IDEAPlugin/IDEAPlugin.jar
然后打开AndroidStudio的Setting页面,选择Plugins ,Install plugin from disk...
安装完成后,会提示重启AndroidStudio来安装插件。
重启后,会发现
多了一个图标,这就是咱们LayoutCast的Run键了。
接下来,在你的项目下的build.gradle下添加
dependencies { compile 'com.github.mmin18.layoutcast:library:1.+@aar' ... }
Application 中注册
public class MyApplication extends Application { @Override public void onCreate() { super.onCreate(); if (BuildConfig.DEBUG) { LayoutCast.init(this); } } }
在AndroidManifest.xml里加入
<application android:name=".MyApplication" .../> <activity android:name="com.github.mmin18.layoutcast.ResetActivity" /> <!--权限--> <uses-permission android:name="android.permission.INTERNET" />
然后直接Run项目在Android5.0手机系统下,项目在手机上跑起来后,就可以适时调整了啦~
每次修改代码后,点击
,手机端回黑屏,显示 Cast DEX in 2 second... 如图
电脑端则会显示
之后 新的代码就可以跑在手机上了,不需要重新编译App 安装App ,每次只需要1秒哟,速度与激情~
相关文章推荐
- android:ellipsize="end" + android:maxLines="" 失败的原因与解决方案
- Android绘制流程
- (4.6.11.1)加快Android编译速度:Buck,LayoutCast,JRebel,Jimulabs,Instant Run
- android 控件 下拉刷新 android-pulltorefresh
- 集成融云Android SDK实现在群聊/讨论组中@人的功能(三)
- Android Studio项目开发实用快捷键!!
- Android中关于保留小数点位数的处理
- Android学习路线总结,绝对干货
- Android学习路线总结,绝对干货
- Android SDK Manager更新报错——Download interrupted URL not found
- Android meta-data
- Android---多级树形菜单的实现
- android--TextView[转]
- android--调用系统相机,显示图片
- 获取Android手机或Pad的屏幕的物理尺寸
- android--Activity跳转传值
- android--设置界面以及数据持久化
- android-- 获取路径目录方法以及判断目录是否存在,创建目录
- android--读取sd卡中text文件
- Android--模拟器尺寸大小修改