Reputation: 4074
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
Reputation: 1704
For Kotlin projects it might be at:
<yourproject>/app/build/intermediates/apk/androidTest/debug
Upvotes: 5
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
Reputation: 22
C:\Users\Admin\AndroidStudioProjects\MyApplication\app\build\outputs\apk
Upvotes: -1
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" -->
Once you run the tests, then and then only a test.apk file gets created in the above mentioned folder.
Upvotes: 10
Reputation: 277
Xamarin.Android - ProjectRootDirectory/bin/debug/PackageName.apk
Android - /AppRootFolder/app/build/outputs/apk/YourApksHere
Upvotes: 0