Dim
Dim

Reputation: 4837

Run specific flavor in gradle

I wish to run specific flavor in my android gradle file. I have two flavors:

productFlavors {

    prod {

    }

    lab {

    }
}

The task assebleRelease will run both of them and create two apk files. I need to create task that will run only prod flavor and create 1 apk file. Can you please help me with this?

Upvotes: 2

Views: 760

Answers (2)

Josef Adamcik
Josef Adamcik

Reputation: 5790

Those tasks should be already created by android gradle plugin. You can use:

gradle assembleProdRelease
gradle assembleLabRelease

Or you can use Gradle panel in Android Studio which contains all gradle tasks.

Gradle panel in android studio

Flavors on example image are named "normal" and "videodebug"

Upvotes: 1

Sanket Kachhela
Sanket Kachhela

Reputation: 10876

You can select variant as mentioned on screenshot

enter image description here

Upvotes: 6

Related Questions