Search code examples
androiddebuggingandroid-studiorelease

Android Studio: run/debug release version of app


I have added gradle build to Android app, and can launch from Android Studio. gradlew build produces debug and released (signed, minified with proguard) versions.

buildTypes {
    debug {
        zipAlignEnabled true
        versionNameSuffix "-" + buildDateTime()
    }
    release {
        minifyEnabled true
        // Eclipse project.properties # proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
        zipAlignEnabled true
        signingConfig signingConfigs.release
        versionNameSuffix "-" + buildDateTime()
    }

But when I adb install on device the release version it crashes on start.

How can I run/debug release version of app from Android Studio to find exact place of problem?

Or can I debug manually released signed apk in Eclipse?


Solution

  • There's a window called 'Build Variants' where you can choose, which version you want to be installed on your emulator/device.

    enter image description here

    You also have to add debuggable true to your release build to be able to debug it.