Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there connectedReleaseAndroidTest gradle task?

I have 2 flavors of my application: paid and free. I have 2 build types: debug and release.

When I issue gradlew tasks I get, among other things:

connectedFreeDebugAndroidTest - Installs and runs the tests for freeDebug on connected devices.

connectedPaidDebugAndroidTest - Installs and runs the tests for paidDebug on connected devices.

But I do not get connectedFreeReleaseAndroidTest neither connectedPaidReleaseAndroidTest.

However, there are for example: testFreeReleaseUnitTest, installFreeRelease and other such tasks dealing with release build type. But no testing tasks for the release build type.

Why is that?

In my build.gradle I have:

androidTestCompile ('com.android.support.test.espresso:espresso-core:+')
androidTestCompile ('com.android.support.test:runner:+')

and also release type only in buildTypes

like image 650
Alexander Kulyakhtin Avatar asked Aug 15 '15 12:08

Alexander Kulyakhtin


People also ask

What are the default Gradle tasks?

Gradle allows you to define one or more default tasks that are executed if no other tasks are specified. defaultTasks 'clean', 'run' tasks. register('clean') { doLast { println 'Default Cleaning!

Does Gradle build run all tasks?

You can execute multiple tasks from a single build file. Gradle can handle the build file using gradle command. This command will compile each task in such an order that they are listed and execute each task along with the dependencies using different options.

How Gradle tasks are executed?

Gradle has different phases, when it comes to working with the tasks. First of all, there is a configuration phase, where the code, which is specified directly in a task's closure, is executed. The configuration block is executed for every available task and not only, for those tasks, which are later actually executed.


1 Answers

In your build.gradle, add:

android {
  testBuildType "release"
}
like image 137
Aaron Sarazan Avatar answered Oct 12 '22 08:10

Aaron Sarazan