启动自定义摇篮的Android打造的Android工作室 [英] Launch custom Gradle Android build in Android Studio
问题描述
有没有一种简单的方法来构建,安装和自动启动的自定义摇篮建立在Android的工作室?
Is there an easy way to build, install, and auto-launch a custom Gradle build in Android Studio?
当我preSS在Android的Studio中的播放(运行)按钮(一个典型的Android项目配置),我生成项目,将其安装在适当的设备上,然后启动应用程序。
When I press the "Play" (Run) button in Android Studio (with a typical Android project configuration), my project builds, installs it on the proper device, and then launches the app.
我怎么能做到这一点的具体构建/产品口味(用摇篮)?我就得到了,创建运行该任务的摇篮配置installFlavor1。这将安装正确,但它不会自动启动该应用程序。
How can I do this with specific Build/Product flavors (using Gradle)? I've gotten as far as creating a Gradle configuration that runs the task "installFlavor1." This installs correctly, but it doesn't auto-launch the app.
推荐答案
您可以随时选择不同的 buildVariant
从 buildVariant窗口
在Android工作室。然后,如果你preSS运行/播放键,你应该能够上安装和设备/模拟器中运行的应用程序。
You can always select a different buildVariant
from the buildVariant window
on Android Studio. And then if you press the run/play button you should be able to install and run the app on your device/emulator.
,也为我跑 gradlew终端上安装**
不启动应用程序。
如果这是你正在寻找再看看 build.gradle
和 buildhelper.gradle
<一个href="https://github.com/varunkochar/Trying-Android-Gradle/tree/master/ProductFlavorsAndBuildTypes/ProductFlavorsAndBuildTypes">here
And also for me running gradlew install**
on the terminal does not launch the app.
If that's something you are looking for then take a look at build.gradle
and buildhelper.gradle
here
这篇关于启动自定义摇篮的Android打造的Android工作室的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!