Is there an easy way to build, install, and auto-launch a custom Gradle build in Android Studio?
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.
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.
If you are already using Gradle with your IntelliJ project, you can open it in Android Studio using the following steps: Click File > New > Import Project. Select your IntelliJ project directory, and click OK. Your project will open in Android Studio.
The top-level build.gradle file, located in the root project directory, defines dependencies that apply to all modules in your project. By default, the top-level build file uses the plugins block to define the Gradle dependencies that are common to all modules in the project.
Gradle is a build system (open source) that is used to automate building, testing, deployment, etc. “build. gradle” are scripts where one can automate the tasks.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With