Skip to content

Instantly share code, notes, and snippets.

@arthtilva
Last active June 15, 2017 11:22
Show Gist options
  • Save arthtilva/656684ef0e003e5b833ddf4d76d100ed to your computer and use it in GitHub Desktop.
Save arthtilva/656684ef0e003e5b833ddf4d76d100ed to your computer and use it in GitHub Desktop.
generate APK as per your required name
buildTypes {
debug {
applicationVariants.all { variant ->
variant.outputs.each { output ->
def date = new Date();
def formattedDate = date.format('dd-MM-yyyy')
output.outputFile = new File(output.outputFile.parent,
output.outputFile.name.replace("-release", "-release_" + formattedDate)
//for Debug use output.outputFile = new File(output.outputFile.parent,
// output.outputFile.name.replace("-debug", "-" + formattedDate)
)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment