Monday, April 10, 2017

How to make apk signed before installing it in Android Device

Step 1:- Execute this command and create an keystore files.

keytool -genkey -v -keystore debug.keystore -alias sampleName -keyalg RSA -keysize 2048 -validity 20000
Fill following information
Password
First and lastname
Name of Organization unit
Name of Organization
City
State
Country
You can find the debug.keystore file in the following location
Step :2 -jarsigner -verbose -keystore debug.keystore C:\Software\Mobile_Automation\app-debug.apk sampleName
or
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore debug.keystore C:\Software\Mobile_Automation\app-debug.apk sampleName
Step 3:- Verify it is signed apk now using below command
jarsigner -verify C:\Software\Mobile_Automation\app-debug.apk

===========

Put your signed apk inside platform-tools folder of Android sdk and execute install command.
C:\Users\test\AppData\Local\Android\sdk\platform-tools>adb.exe install app-debug.apk
[100%] /data/local/tmp/app-debug.apk
pkg: /data/local/tmp/app-debug.apk
Success

No comments: