Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@FranRiadigos
Last active June 15, 2018 10:24
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 FranRiadigos/a40692dbbd390dd68de6bc76490afee8 to your computer and use it in GitHub Desktop.
Save FranRiadigos/a40692dbbd390dd68de6bc76490afee8 to your computer and use it in GitHub Desktop.
Example of overriding an apk name with custom values and signed or unsigned suffix.
applicationVariants.all { variant ->
variant.outputs.all {
outputFileName =
"${project.name.toLowerCase()}-" + // app
"${variant.flavorName}-" + // develop
"${variant.buildType.name}-" + // debug
"${versionCode}" + // 10101
(variant.buildType.name.contains("release")
&& !variant.signingReady ? "-unsigned" : "") + // unsigned
".apk" // i.e.: app-develop-debug-10101-unsigned.apk
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment