1

According to https://developer.android.com/studio/build/building-cmdline, to build and install the app I should run

./gradlew installDebug

but this only installs the app.

The way to launch it programatically is listed here https://stackoverflow.com/a/4567928 with

adb shell am start -n com.package.name/com.package.name.ActivityName

is there a way to build, install and launch with gradle? Why there's no task for this?

Guerlando OCs
  • 1,886
  • 9
  • 61
  • 150
  • 1
    Because that isn't enough. What if no emulator is running (or device attached)? What if multiple are? How do you choose which to install and run it on? Or which emulator to start up? How do you know which Activity to launch (while one is the default, Gradle would need to know that. Currently it doesn't). Basically, there's enough decisions that would need to be made that there isn't real value in it. If you have a common use case, write your own gradle command to do it. – Gabe Sechan Jun 15 '21 at 00:35

0 Answers0