2
votes

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

4

4 Answers

3
votes

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 :)

2
votes

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.

1
votes

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.

0
votes

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