Browse Tag

android studio

Run signed apk on your device via Android Studio

  1. Open local.properties and add there keystore location, alias and password:This file must NOT be checked into Version Control Systems, as it contains information specific to your local configuration and password now.
    password=your_password
    keystore=C\:/keystore_location/keystore.jks 
    alias=your_alias
  2. Add signingConfigs at build.gardle of the module:
    android {
    ...
        signingConfigs {
            release {
            keyAlias alias
            keyPassword password
            storeFile file(keystore)
            storePassword password
            }
        }
    ...
    }
  3. Add build types:
    android {
    ...
        buildTypes {
            debug {
                minifyEnabled true
                proguardFiles getDefaultProguardFile('p.txt'), 'proguard-rules.pro'
                shrinkResources true
            }
            release {
                minifyEnabled true
                proguardFiles getDefaultProguardFile('p.txt'), 'proguard-rules.pro'
                shrinkResources true
                signingConfig signingConfigs.release
            }
        }
    ...
    }
  4. Before running choose build variant:
    Capture