android - How to generate signed and unsigned APK's using gradle? -
i need generate both unsigned , signed release apks using gradle command line (gradlew assemblerelease
command im using now)
the apks must aligned. checked this: build unsigned apk gradle seems old way achieve this, not work , has changed in lastest versions of android , gradle compilation. , need generate both apks @ same time, not release mode or unsigned mode
i think buildtypes
more suitable place productflavors
.
can extend release build replacing signingconfig.
buildtypes { release { .... signingconfig signingconfigs.release } releaseunsigned.initwith(buildtypes.release) releaseunsigned { signingconfig null } }
then building both apk-files:
./gradlew assemble
or if want release builds
./gradlew assemblerelease assemblereleaseunsigned or ./gradlew assr assru
if want use assemblerelease task, can make dependency
assemblerelease.dependson assemblereleaseunsigned
and build just
./gradlew assemblerelease
Comments
Post a Comment