Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute .bat from Android gradle after APK build

I`m moving my project to Gradle build system. After APK build I need to sign it with manufacturer certificate.

How to execute .bat file by Gradle after APK was built?

task runSign(type:Exec) {
    println "Sign apk..."
    commandLine = ['cmd','/c','sign.bat']
}

I know just how to run .bat before build (but I need after):

preBuild.doLast {
    runSign.execute()
}
like image 881
yuralife Avatar asked Nov 25 '25 08:11

yuralife


1 Answers

I've found the solution.

Go to Run -> Edit Configurations...

Choose module where you want to run task after APK build. Add new configuration after "Gradle-aware Make".

Picture 1

Click on icon at picture below to choose module where task is implemented and write name of it.

Picture 2

After this steps your custom Gradle task will be executed after APK build.

like image 59
yuralife Avatar answered Nov 26 '25 22:11

yuralife



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!