Skip to content

Instantly share code, notes, and snippets.

@jmarsican
Created April 7, 2020 01:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmarsican/17530944bb14ec7556c88fc94d0fe1c6 to your computer and use it in GitHub Desktop.
Save jmarsican/17530944bb14ec7556c88fc94d0fe1c6 to your computer and use it in GitHub Desktop.
Gradle function to create a custom task to be executed upon other and copy the apk file in the desired location
task getDebugAppInDesktopFolder(dependsOn: 'assembleDebug') {
doLast {
def destination = "Put the desired path"
def desiredName = "Put the desired name"
ext.apk = file("build/outputs/apk/debug/app-debug.apk")
if (ext.apk.exists()) {
copy {
from ext.apk.absolutePath
into destination
rename { desiredName }
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment