android { applicationVariants.all { variant -> variant.outputs.all { def flavor = variant.productFlavors[0].name if (flavor == 'prod') { // Open folder for specific flavor variant.assemble.finalizedBy openFolderWithApk } } } task openFolderWithApk(type:Exec) { workingDir '../app/prod/release/' //Update flavor and buildType commandLine 'cmd', '/c', 'start .' //on windows } }