shrw
shrw

Reputation: 1795

android gradle/gradlew command line build for creating apk

In Android, I don't want to use Android Studio.

Is there an android gradle/gradlew command for creating a release apk, which could be used to sign and upload to play store.

I tried ./gradlew build

this gives "BUILD SUCCESSFUL" but doesn't creates an apk.

Upvotes: 0

Views: 512

Answers (1)

Shayan Tabatabaee
Shayan Tabatabaee

Reputation: 447

you should add your signingConfig in your build.gradle file like this :

signingConfigs {
        signConfig {
            keyAlias '****'
            keyPassword '*****'
            storeFile file('******')
            storePassword '*****'
        }
    }

and use this command if you are in windows : grdalew assembleRelease or this if you are in mac : ./gradlew assembleRelease

please note that if you add signingConfigs in your gradle file, the gradle will automatically sign APK for you and if you don't, the gradle will build unsigned APK and you can sign it later.

Upvotes: 1

Related Questions