本文介绍了Android Studio 的设备选择器在 Gradle Build 完成之前显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Android Studio 1.5 之前,设备选择器在 Gradle Build 完成时显示.

Prior to Android Studio 1.5, the device chooser was shown upon Gradle Build completion.

这允许使用构建时间来物理配置设备、进行任何最后一分钟的更改或确保设备在安装时实际连接.如果我想取消我的 gradle 运行而不中断我的工作流程,我也会断开设备连接.

This allowed to use build time to physically configure devices, make any last minute changes or to ensure that devices were actually connected at the time of install. I also disconnected devices if I wanted to cancel my gradle run without interrumpting my workflow.

在 Gradle Build 完成之前显示设备选择器,我被迫在开始构建之前物理连接我的设备;这让我失去了在 Gradle Build 完成时执行任何连接时本可以节省的时间.我也不能确保在构建完成时安装不会失败,因为在构建完成时我的任何连接的设备都不再可用,或者 adb 甚至可能停止响应(这种情况并不少见).

With the device chooser showing before Gradle Build completion I am forced to have my devices physically connected before starting my build; this makes me lose time I could've saved while performing any connections while the Gradle Build was completing. I am also not ensured that installation won't fail when the build is finished since any of my connected devices could no longer be available by the time the build has completed or adb could even stop responding (which is not that uncommon).

我确定它仍然是某些人的偏好问题,但是,是否可以配置设备选择器,使其在之后 Gradle Build 完成并准备将 apk 上传到我的设备?

I'm sure it will still a matter of preference for some but, is it possible to configure the device chooser so that it appears after Gradle Build has completed and is ready to upload the apk to my devices?

推荐答案

根据 Android Studio 1.5 Preview 2 发行说明:

在 1.5 中,我们重新设计了构建 + 部署流程,而不是首先使用 Gradle 构建然后弹出选择设备"对话框,我们现在立即要求将 APK 推送到的设备.一些用户使用 Run + Cancel 构建 APK;为此,我们现在在构建"菜单中添加了一个单独的构建 APK"操作.

因此,在没有选定设备的情况下开始构建的唯一选择是使用构建 APK 操作.

So the only option to start a build without a selected device is to use the Build APK action.

这篇关于Android Studio 的设备选择器在 Gradle Build 完成之前显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 09:42