Skip to content

Instantly share code, notes, and snippets.

@bmc08gt
Created July 20, 2021 19:40
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bmc08gt/92b15ef9bc86529864343b565d15e71d to your computer and use it in GitHub Desktop.
Save bmc08gt/92b15ef9bc86529864343b565d15e71d to your computer and use it in GitHub Desktop.
Gradle task to piggyback off install task allowing CLI opening of the app.
android.applicationVariants.all { variant ->
task "open${variant.name.capitalize()}" {
dependsOn "install${variant.name.capitalize()}"
doLast {
exec {
commandLine "adb shell monkey -p ${variant.applicationId} -c android.intent.category.LAUNCHER 1".split(" ")
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment