Skip to content Skip to sidebar Skip to footer

How To Sign Android Apk Without Android Studio

I have found many many confusing answers on this one: How do I sign (release/debug) android app without Android Studio (E.g. when signing ionic/cordova/phonegap app)?

Solution 1:

You can Add Key store in Gradle file.

 android {
    ...
    defaultConfig { ... }
    signingConfigs {
        release {
            if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
                storeFile file(MYAPP_RELEASE_STORE_FILE)
                storePassword MYAPP_RELEASE_STORE_PASSWORD
                keyAlias MYAPP_RELEASE_KEY_ALIAS
                keyPassword MYAPP_RELEASE_KEY_PASSWORD
            }
        }
    }
    buildTypes {
        release {
            ...
            signingConfig signingConfigs.release
        }
    }
}

--> use CMD for generate signed APK.

gradlew assemblerelease.

Solution 2:

So, the right and simple answer to date is:

  1. cd into your project platform/android folder (might just be your main project folder if not cordova/ionic build). You should find your main build.gradle file in that folder.

  2. Create a keystore file by calling:

     keytool -genkey -v -keystore <KEYSTORE_FILE_NAME>.keystore -alias <ALIAS_NAME> -keyalg RSA -keysize 2048 -validity 10000
     

Follow along and fill in <ALIAS_NAME> and passwords (write them down in a place you'll find them!)

  1. Create two files named: debug-signing.properties and release-signing.properties

  2. Enter the following configuration to both (you can later change the keystore to harden the security for release build...):

     keyAlias=ALIAS_NAME
     keyPassword=ALIAS_PASSWORD
     storeFile=KEYSTORE_FILE_NAME
     storePassword=KEYSTORE_PASSWORD`
     
  3. Run build ...


Solution 3:

Ionic team giving a great idea about this query you can follow this link and you can do this with in 10 min's

http://ionicframework.com/docs/guide/publishing.html

But You need android sdk to do this ...

To set ANDROID_HOME

Windows

set ANDROID_HOME=Path to sdk 

Linux Based Systems

export ANDROID_HOME=Path to sdk

Steps to Follow

  1. Create release app

  2. Create keystore

  3. Signing the APK


Solution 4:

I had the same problem. The easiest solution is to come back to the fundamentals through the DOS commands keytool and jarsigner. Note that these files must be located in the jdk directory to work well.

Only two actions to do:
- to use keytool for creating your keystore and your certificate(s):the first certificate is created when you create the single keystore. Then, the other certificates will be created by calling again the keytool command with the same keystore name
- then to use jarsigner. Prefer to differentiate the jar input filename and the generated signed jar filename when you prepare your jarsigner command


Post a Comment for "How To Sign Android Apk Without Android Studio"