2

I am trying to get my key and it says to paste the following command

keytool -genkey -v -keystore my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000

I do not understand how this works, am I supposed to change some of that text? When I paste it as is it asks me for a password, what password is it asking for? Thanks

Adam Katz
  • 6,999
  • 11
  • 42
  • 74

4 Answers4

3

It seems you are going to publish your first Android app. I recommend you to read this official guide before you do it.

If you are too lazy to read all the stuff, at least read this article about your specific issue.

Good luck :)

matusalem
  • 2,461
  • 2
  • 26
  • 35
2

you are generating key .When you do this. you must give password and other information (name etc.) .you must store this values. and Dont lost your key.if you delete or lost. your app cannot be updated.

Nazır Dogan
  • 1,494
  • 15
  • 31
  • yes I understand that part, but where do I put this information? Do I edit that line of code? – Adam Katz May 08 '16 at 22:07
  • my-release-key.keystore and my-key-alias are your information about your apps. give more specific name.after that . you must use jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore HelloWorld-release-unsigned.apk alias_name – Nazır Dogan May 08 '16 at 22:10
  • and finally use zipalign : zipalign -v 4 HelloWorld-release-unsigned.apk HelloWorld.apk – Nazır Dogan May 08 '16 at 22:11
  • You are losing me here, my app is called SASSI-LIST what other information do I need? – Adam Katz May 08 '16 at 22:22
  • ok .lets started at begining. Do you have apk file ? I suppose you have for example . sassi-list.apk – Nazır Dogan May 08 '16 at 22:26
  • first of all generate key keytool -genkey -v -keystore sassi-list-release-key.keystore -alias sassi-list-key-alias -keyalg RSA -keysize 2048 -validity 10000 – Nazır Dogan May 08 '16 at 22:27
  • after that sign your apk with key : jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore sassi-list-release-key.keystore Sassi-list-release-unsigned.apk sassi-list-alias – Nazır Dogan May 08 '16 at 22:29
  • finally, zipalign -v 4 sassi-list-release-unsigned.apk SassiList.apk – Nazır Dogan May 08 '16 at 22:30
  • you can find more info about publishing process :http://ionicframework.com/docs/guide/publishing.html .its ionic(cordova) its about andorid. – Nazır Dogan May 08 '16 at 22:31
1

While the other answers given are correct, here is a more React Native oriented answer:

I assume you are following the Generating Signed APK steps in the docs (if not, you should be). The command it tells you to run should be customized by changing 2 of the parameters to be app-specific:

  1. Change my-release-key.keystore (e.g. todo-release-key.keystore)
  2. Change my-key-alias (e.g. todo-key)

When you run the command it will ask you for a password for the keystore and key it creates (the same way you get asked for a password when creating a new SSH key). It will also ask you for the Distinguished Name for the certificate. Here is a good answer on what you should enter here: https://stackoverflow.com/a/3284135/1949302

From there, just continue following the steps in the documentation, replacing the keystore and alias values to the ones you used when running the command.

Community
  • 1
  • 1
Dan Horrigan
  • 1,275
  • 7
  • 8
0

Follow the below steps for windows os:

1 Open cmd as administrator

2 In cmd go to C:\Program Files\Java\jdk1.8.0_131\bin> // check your file name

cd C:\Program Files\Java\jdk1.8.0_131\bin>

3 Enter the following command in cmd

keytool -genkey -v -keystore F:/my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000

Then give Answers in cmd and then my-release-key.keystore will be created in F: drive

GAURAV
  • 647
  • 6
  • 18