如何在 AndroidStudio 2.0 中激活 Instant Run [英] How to activate Instant Run in AndroidStudio 2.0

查看:29
本文介绍了如何在 AndroidStudio 2.0 中激活 Instant Run的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Android studio 2.0 引入了即时运行工具,它对我不起作用,我知道 2.0 在预览频道中

Android studio 2.0 introduced instant run facility, its not working for me, I know 2.0 is in the preview channel

有人用 instarun 工具尝试过 2.0 吗?

Anybody tried 2.0 with instarun facility?

推荐答案

对于使用 Android Gradle Plugin 2.0.0 或更高版本构建的项目,默认情况下启用 Instant Run.要使用最新版本的 Gradle 插件更新现有项目,请转到设置"对话框:

在 Mac 上,点击 Android Studio → 首选项
在 Windows 和 Linux 上,单击文件 → 设置

Instant Run is enabled by default for projects built using Android Gradle Plugin 2.0.0, or later. To update an existing project with the latest version of the Gradle plugin, go to the Settings dialog:

On Mac, click Android Studio → Preferences
On Windows and Linux, click File → Settings

在设置/首选项对话框中,转到构建、执行、部署 → 即时运行.
单击更新项目链接.出现提示时,单击确定".
如果更新项目"链接未出现,则您的项目已经最新.

使用 Instant Run


In the Settings/Preferences dialog, go to Build, Execution, Deployment → Instant Run.
Click the Update Project link. When prompted, click OK.
If the the Update Project link does not appear, your project is already up to date.

Using Instant Run


要首先运行您的应用,请点击运行‘应用’(或调试‘应用’).Android Studio 将通过编译、dexing、打包和安装 .APK 文件并启动应用程序来运行您的应用程序.在您的应用启动后,一个黄色的小雷电会出现,并带有运行‘应用’按钮(或调试‘应用’按钮).这表明 Instant Run 功能已准备就绪.

To first run your app, click Run ‘app’ (or Debug ‘app’ ). Android Studio will run your app by compiling, dexing, packaging and installing an .APK file, and launching the app. After your app has launched, a small, yellow thunderbolt will appear with the Run ‘app’ button (or Debug ‘app’ button). This indicates that the Instant Run feature is ready.

再次点击运行‘应用’(或调试‘应用’)将启动即时运行,您的更改会在几秒钟内推送到连接的设备.

Clicking Run ‘app’ (or Debug ‘app’) again will start an Instant Run and your changes are pushed to the connected device within a few seconds.

要终止您设备上正在运行的应用,请点击停止‘应用’.

To terminate the running app on your device, click Stop ‘app’ .

这篇关于如何在 AndroidStudio 2.0 中激活 Instant Run的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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