启动自定义摇篮的Andr​​oid打造的Andr​​oid工作室自定义、摇篮、工作室、Andr

2023-09-06 02:16:35 作者:冰冷的温柔

有没有一种简单的方法来构建,安装和自动启动的自定义摇篮建立在Android的工作室?

Is there an easy way to build, install, and auto-launch a custom Gradle build in Android Studio?

当我preSS在Android的Studio中的播放(运行)按钮(一个典型的Andr​​oid项目配置),我生成项目,将其安装在适当的设备上,然后启动应用程序。

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 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

 
精彩推荐