Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android testing release build

I tried to test the release build of the app. So I have added the below config to build.gradle of my app. But that didn't make any effect. Test always runs on debug build

android {
 compileSdkVersion 24
 buildToolsVersion "24.0.0"

defaultConfig {
  applicationId "com.****.****"
  minSdkVersion 15
  targetSdkVersion 22
  versionCode 1
  versionName "1.0 Beta"
  testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

testBuildType "release"

signingConfigs {
  release {
    keyAlias '******'
    keyPassword '*****'
    storeFile file('path to keystore')
    storePassword '*****'
  }
}

buildTypes {
  release {
    minifyEnabled true
    debuggable true
    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    signingConfig signingConfigs.release
   }
   debug {
     multiDexEnabled true
   }
  }
}

When searched for answers in other SO thread I found testBuildType "release" will run test on release build but it did not work

like image 629
arjun Avatar asked Feb 22 '17 11:02

arjun


People also ask

What is the difference between release and debug build Android?

Major differences are the debug apk and the release apk: For debug builds the apk will be signed with the default debug signing keys with debug flag enabled. For release apk you will have to explicitly specify the apk to sign with and the debug flag will be turned off so that it cannot be debugged.


1 Answers

I'm not sure I got it all, but a few things :

  • You can test your release with the build variant menu on Android studio (menu at the bottom left) (@Sagar Chavada suggestion)

enter image description here

  • When you generate your signed apk with Android studio you can choose at the end the build type, release in your case enter image description here
  • I know it's for testing purpose but debuggable true in your realease build won't allow you to push it on Google play
like image 81
Sebastien FERRAND Avatar answered Oct 07 '22 07:10

Sebastien FERRAND