12

Hi I tried generated signed apk 1 times for testing and now i only want to stimulate on tested devices but android studio always generated signed apk. That will make the process longer (every time I hit run button android studio will generated signed apk automatically) how to disable auto generated signed apk? i just want to run app on simulator only?

2
  • change the build variant from *release to *debug
    – Adeeb
    Commented Nov 24, 2015 at 7:45
  • Thanks How to change the build variant? Commented Nov 24, 2015 at 7:52

4 Answers 4

9

There is a tab, which is normally at the bottom left corner of AS. Change it from *release to *debug.

Build variant tab

(Image source : Matt W Ott, Android TDD with Robolectric and JUnit)

5
  • 1
    I have checked according to the image. Change to debug already but still auto generate signed apk. Dont know why Commented Nov 24, 2015 at 8:49
  • can i see your build.gradle file, the signingConfigs part.
    – Adeeb
    Commented Nov 24, 2015 at 9:48
  • My build.gradle// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.5.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() flatDir { dirs 'libs' } } } task clean(type: Delete) { delete rootProject.buildDir } Commented Nov 24, 2015 at 9:53
  • Not the top-level build file, i am interested in the second one : the one specific to your app module.
    – Adeeb
    Commented Nov 24, 2015 at 9:57
  • perfect answere some whow Commented Nov 23, 2017 at 12:07
2

Android Studio seems to always do the last build type you did.

So just select Build -> Build APK, and next time it will do this instead of Generate Signed APK.

0

When running or debugging your project from the IDE, Android Studio automatically signs your APK with a debug certificate generated by the Android SDK tools. The first time you run or debug your project in Android Studio, the IDE automatically creates the debug keystore and certificate in $HOME/.android/debug.keystore, and sets the keystore and key passwords.

If the build variant is RELEASE, you have to provide the signing config but the apk must be signed becuase:

Android requires that all APKs be digitally signed with a certificate before they can be installed.

Source: Sign Your App

0

try to this way opens
build.gradle(Module:app) Then go to buildTypes {} and Remove (Delete)

debug {signingConfig signingConfigs.config}

then Sync Now and run "app"

Not the answer you're looking for? Browse other questions tagged or ask your own question.