1

When I'm developing, always use Run(Shif+F10) button. But Run makes unsigned application. So if I want to test my app, i must do Build > Generate Signed APK > install. It's very annoying. So I want to sign automatically when I click Run button.

If it's impossible, please tell me useful function for testing my app

Asif Patel
  • 1,744
  • 1
  • 20
  • 27
Jrog
  • 1,469
  • 10
  • 29

3 Answers3

4

Yes, it's possible use following code add into your Gradle script.

I managed to solve it adding this code, and building with gradle build:

android {
...
signingConfigs {
    release {
        storeFile file("release.keystore")
        storePassword "******"
        keyAlias "******"
        keyPassword "******"
    }
}
buildTypes {
    release {
        signingConfig signingConfigs.release
    }
}

}

This generates a signed release apk file. Also while generate your api please ensure that your buid veriant is Relese like this.

enter image description here

Himeshgiri gosvami
  • 2,559
  • 4
  • 16
  • 28
1

You should edit your run config like below;

1- Click edit build types; enter image description here

2- Create signing configration with your keystore file.

enter image description here

3- Choose your signing config for debug build

enter image description here

Hope it helps!

oyenigun
  • 587
  • 6
  • 15
-1

its not possible, generate signed apk is the only way to get the signed app if you get the signed apk through run there is no need for generate signed apk option in the studio so its not possible

Dina Gar
  • 120
  • 9