Sign the apk on windows

i built my app with meteor for windows 8.1.

now i would like to publish into google play.
i successfully ran ‘build’ and now have a ‘release-unsigned.apk’ in my build in the android folder, hallelujah.

the documentation now reads:
If you haven’t made a key for this app yet, run:
keytool -genkey -alias your-app-name -keyalg RSA -keysize 2048 -validity 10000

so, i guess this goes in the command line tool. so i do ‘windows’+R -> cmd.

when i run the command i get an error and not a key.

how does this work on windows.
it’s impossible to ‘import’ an apk in android studio.

has anyone made it past this??!
any hints would be highly appreciated and celebrated.

kind regards,

has noone ever published a meteor app from windows into google play???

What error do you get when executing this command?

thank you for writing back!!

i got the error that the command was unknown.

i figured out what to do (3 hours) - which is missing completely in the documentation:

cd into a special java folder
cd C:\Program Files\Java\jre7\bin

and then run keytool.exe

then run this command:
keytool -genkey -v -keystore C:\Users\ma-ia\Desktop_temp\longevitybasics_build\android\longevitybasics.keystore -alias LongevityBasics -keyalg RSA -keysize 2048 -validity 2000

… which creates the keystore-file. nice.

now i am supposed to run a jarsign command to merge unsigned apk and the keystore file into a signed apk:

jarsigner -verbose -keystore C:\Users\ma-ia\Desktop_temp\longevitybasics_build\android\longevitybasics.keystore -storepass Mypassword -keypass C:\Users\ma-ia\Desktop_temp\longevitybasics_build\android\release-unsigned.apk longevitybasics

again the same problem - command unknow. i guess i have to install something or cd into something.

do you know??!

thanks so much

jarsigner tool should be in the same directory where keytool was, so you have to either cd to that directory or use full path to this command when executing it.

Normally you should not get those errors. The reason you get them is because for some reason Java binaries directory (%JAVA_HOME%\bin) was not added to your PATH when you installed it. Can’t help you much there because I don’t use Windows, but you can try to Google how to handle this so it makes stuff easier for you in the future.

Edit: This article may help you:

jarsigner is here:
C:\Program Files\Java\jdk1.8.0_102\bin

now after running jarsigner.exe i can execute the jarsigner-command without error:

jarsigner -verbose -keystore C:\Users\ma-ia\Desktop_temp\longevitybasics_build\android\longevitybasics.keystore -storepass mypassword -keypass mypassword C:\Users\ma-ia\Desktop_temp\longevitybasics_build\android\release-unsigned.apk longevitybasics

but nothing happens.
i was hoping a signed apk appears.

any ideas??

thank you!

It signs the APK file you provide (release-unsigned.apk), it doesn’t output a new file.

1 Like