0

I have bought an android app source code from codecanyon. I want to generate android apk for distribution without android studio. Any alternative?

Reason: I have some problem installing android studio in my pc which makes it impossible to use android studio.

aminography
  • 21,986
  • 13
  • 70
  • 74

2 Answers2

0

You should specify signingConfigs and buildTypes in build.gradle's android block. For example:

android {
    defaultConfig {
        ...
    }
    signingConfigs {
        config {
            keyAlias '...'
            keyPassword '...'
            storeFile file('../key.jks')
            storePassword '...'
        }
    }
    buildTypes {
        debug {
            useProguard false
            minifyEnabled false
            debuggable true
            applicationIdSuffix '.debug'
        }   
        release {
            signingConfig signingConfigs.config
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            useProguard true
            minifyEnabled true
            debuggable false
            shrinkResources true
        }
    }
}

Then from terminal or command prompt in root path of your project, run the following commands:

// To generate debug apk
gradlew assembleDebug

// To generate release apk
gradlew assembleRelease
aminography
  • 21,986
  • 13
  • 70
  • 74
0

yes you can do it in command line. see the tutorial from official site with this link