ARK
ARK

Reputation: 4074

Where is the test apk located in Android Project?

For running tests, Android Studio/Gradle generates a test apk which performs tests on the app apk. Can anyone share where the test apk gets generated and the location inside the project?

Following is my app/build.gradle

apply plugin: 'com.android.application'

android {
   compileSdkVersion 25
   buildToolsVersion "25.0.2"
   defaultConfig {
      applicationId "com.ark.beacons_test"
      minSdkVersion 16
      targetSdkVersion 25
      versionCode 1
      versionName "1.0"
      testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
   }
   buildTypes {
      release {
         minifyEnabled false
         proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
      }
   }

   packagingOptions {
      exclude 'META-INF/LICENSE'
   }

}

dependencies {
   compile fileTree(include: ['*.jar,*.aar'], dir: 'libs')
   compile(name: 'android-lib', ext: 'aar')
   compile 'com.android.support:appcompat-v7:25.3.1'
   compile 'com.android.support.constraint:constraint-layout:1.0.2' 
   androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
   })
   testCompile 'junit:junit:4.12'
}

Upvotes: 9

Views: 11897

Answers (6)

Khongor Bayarsaikhan
Khongor Bayarsaikhan

Reputation: 1704

For Kotlin projects it might be at: <yourproject>/app/build/intermediates/apk/androidTest/debug

Upvotes: 5

Andrew Glukhoff
Andrew Glukhoff

Reputation: 916

Do not confuse app apk and test apk. In my case, app apk is called app-debug.apk and is located in \app\build\outputs\apk\debug and test apk is called app-debug-androidTest.apk and is located in \app\build\outputs\apk\androidTest\debug. Both of them you load simultaneously in Firebase Test Lab.

Upvotes: 4

Vijay Bhosale
Vijay Bhosale

Reputation: 22

C:\Users\Admin\AndroidStudioProjects\MyApplication\app\build\outputs\apk

Upvotes: -1

ARK
ARK

Reputation: 4074

The test apk is generated in rootProject/app/build/outputs/apk/ folder. But to generate the test.apk file, you have to add instrumented tests in src/androidTest folder, atleast one dummy test. Then run the tests on a device by right clicking in project explorer and then select "Run All Tests" or "Run Tests" -->

enter image description here

Once you run the tests, then and then only a test.apk file gets created in the above mentioned folder.

Upvotes: 10

Brandon Tripp
Brandon Tripp

Reputation: 277

Xamarin.Android - ProjectRootDirectory/bin/debug/PackageName.apk

Android - /AppRootFolder/app/build/outputs/apk/YourApksHere

Upvotes: 0

Arunava
Arunava

Reputation: 351

/YourProject/app/build/outputs/apk

Upvotes: 1

Related Questions