Help with final stages?

I have completed my app and built the .apk file and it’s all ready to rock and roll except I need to do something about a keystore… I read the corona page about doing this with cmd but I did not understand what I’m required to do here.

If someone could explain to me what I’m supposed to type into the cmd in order to sign the .apk file correctly so it can be uploaded to the play store, I would be very grateful!!

(I am aware that it can be done through Eclipse but I am having some troubles with it and would rather do it through cmd or any other method.) 

I’m a complete newbie to all of this stuff so a little guidance would be appreciated.

Thank you!! 

Freddie

Hello Freddie,

Did you follow the instructions in the “Signing for Release Build” box in this guide?

http://docs.coronalabs.com/guide/distribution/androidBuild/index.html#installapp

Take care,

Brent

Hi Brent I did see this documentation but I am unsure of what the “keytool” is and I am also unfamiliar with what the “cd” command is. Once I know what these are I’m sure following the rest of the instructions will be a breeze. Freddie

Hi Freddie,

“cd” basically means " c hange d irectory". Are you familiar with using the Terminal or Command Prompt?

I also forgot to ask… are you using Mac or Windows?

I am unfamiliar with command prompt in this instance and I am using windows.

We really can’t school you in how to use the command line.  There are many tutorials on the Internet that can help you figure that out.  If you open the cmd window and type “keytool” without the quotes what message do you get?

In general:

keytool -genkey -v -keystore mykeystore.keystore -alias aliasname -keyalg RSA -validity 999999

runs a command called keytool.  It will output a file called a keystore.  In the example above, it will be named “mykeystore.keystore”.  You might want to name yours differently or you might be happy with that name.  It will output that file in whatever folder on your hard drive you run it in.  If you just run the cmd shell and type it into your terminal, it will likely put the file at the top level of your C drive… i.e. it will be:  C:\mykeystore.keystore

The other important thing on the command line is the -alias option.  If you just cut and paste the command, your keystore will get an alias with the name “aliasname”.  You most likely don’t want this.  You want to give it an alias that you remember.  Perhaps this command would be something you could cut and paste:

keytool -genkey -v -keystore release.keystore -alias release -keyalg RSA -validity 999999

You only need to do this one (or better, once per app).  Then in your Corona SDK build screen, for the “Keystore” entry, click on the Browse button and navigate to where your keystore is stored (likely the C:\ path if you didn’t do a “cd” command).  Select your keystore.  In the next drop down pick the alias you used (i.e. “release” from above).

When the Corona SDK build process is done, you should have a properly signed .apk file.

Rob

No this is perfect, everything I needed to know. I appreciate your help. Thank you!

Best regards

Freddie

I just tried this and used my own keystore name and alias but I got the error “keytool is not a recognised as an internal or external command, operable program or batch file”

Then you either a) don’t have keytool installed or b) it’s not in your system’s “PATH”. 

I would suggest that you use Google and find some tutorials on how to install the keytool on Windows and see if that can get you going.

Rob

Hello Freddie,

Did you follow the instructions in the “Signing for Release Build” box in this guide?

http://docs.coronalabs.com/guide/distribution/androidBuild/index.html#installapp

Take care,

Brent

Hi Brent I did see this documentation but I am unsure of what the “keytool” is and I am also unfamiliar with what the “cd” command is. Once I know what these are I’m sure following the rest of the instructions will be a breeze. Freddie

Hi Freddie,

“cd” basically means " c hange d irectory". Are you familiar with using the Terminal or Command Prompt?

I also forgot to ask… are you using Mac or Windows?

I am unfamiliar with command prompt in this instance and I am using windows.

We really can’t school you in how to use the command line.  There are many tutorials on the Internet that can help you figure that out.  If you open the cmd window and type “keytool” without the quotes what message do you get?

In general:

keytool -genkey -v -keystore mykeystore.keystore -alias aliasname -keyalg RSA -validity 999999

runs a command called keytool.  It will output a file called a keystore.  In the example above, it will be named “mykeystore.keystore”.  You might want to name yours differently or you might be happy with that name.  It will output that file in whatever folder on your hard drive you run it in.  If you just run the cmd shell and type it into your terminal, it will likely put the file at the top level of your C drive… i.e. it will be:  C:\mykeystore.keystore

The other important thing on the command line is the -alias option.  If you just cut and paste the command, your keystore will get an alias with the name “aliasname”.  You most likely don’t want this.  You want to give it an alias that you remember.  Perhaps this command would be something you could cut and paste:

keytool -genkey -v -keystore release.keystore -alias release -keyalg RSA -validity 999999

You only need to do this one (or better, once per app).  Then in your Corona SDK build screen, for the “Keystore” entry, click on the Browse button and navigate to where your keystore is stored (likely the C:\ path if you didn’t do a “cd” command).  Select your keystore.  In the next drop down pick the alias you used (i.e. “release” from above).

When the Corona SDK build process is done, you should have a properly signed .apk file.

Rob

No this is perfect, everything I needed to know. I appreciate your help. Thank you!

Best regards

Freddie

I just tried this and used my own keystore name and alias but I got the error “keytool is not a recognised as an internal or external command, operable program or batch file”

Then you either a) don’t have keytool installed or b) it’s not in your system’s “PATH”. 

I would suggest that you use Google and find some tutorials on how to install the keytool on Windows and see if that can get you going.

Rob