Reputation: 1226
In Ionic 5, doing an Android build with ionic cordova build android
produces an output file called app-debug.apk
, or app-release.apk
. How can I rename that file?
Upvotes: 0
Views: 597
Reputation: 1226
build-extras.gradle
somewhere in your Ionic project.build-extras.gradle
, add the following to set the name of the output file to a property myOutputName
:android {
setProperty("archivesBaseName", myOutputName)
}
config.xml
, add the following within <platform name="android">
, to make the build use your build-extras.gradle
file:<resource-file src="path/to/build-extras.gradle" target="build-extras.gradle" />
ionic cordova build android -- -- --gradleArg=-PmyOutputName=NewFileName
This will produce a file called NewFileName.apk
.
Upvotes: 2