It requires installing “Android Studio” with “SDK manager”. “Java SDK” and set the “PATH” system indicating the route to both.
Where it says appname put the name of your app .
This tutorial is valid for MAC, I have not tested on WIN or Linux but I guess it is the same.
1. Remove console development: cordova plugin rm org.apache.cordova.console.
2. Generate apk: `cordova build android --release` . You create the file android-release-unsigned.apk in the folder: appfolder/platforms/android/build/outputs/apk/
3. Generate Key: `keytool -genkey -v -keystore appname-key.keystore -alias appname -keyalg RSA -keysize 2048 -validity 10000` it generate file appname-key.keystore
4. Remember to record the key used to generate the key
5. Copy file in the same folder as the Step 2: appfolder/platforms/android/build/outputs/apk/
6. Move to the previous directory and run `jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore appname-key.keystore android-release-unsigned.apk appname`
7. Align apk: `zipalign -v 4 android-release-unsigned.apk appname.apk`
8. It generate valid apk with the name: appname.apk
9. Upload to Google Play first as Beta later promote to Prod.
I zipalign my app in C:\Program Files (x86)\Android\android-sdk\build-tools\21.0.0 directory… It says verification success full… Where will be the apk will store now.
C:\app\rmu\platforms\android\build\outputs>zipalign -v 4 android-release-unsigne
d.apk rmu.apk
’zipalign’ is not recognized as an internal or external command,
operable program or batch file.
It seems like you don’t have Android Studio installed on your computer. If its allready installed you have to Setting ANDROID_HOME Environmental Variable.
It’s all going well, i have my android-release-unsigned.apk get into the project, start the keytool -genkey command
then enter all my details (name and such) then, when it asks for confirmations, showing me my key details, i only get a [no]: …
I tried everything, Y, y, enter… etc but it’s always asking me again my details and doesn’t generate any key, it’s looping over and over again over my details when i press enter
Is this a bug or am i doing something wrong ? is there a super secret command to generate the key ??? Thanx in advance (im on OSX)
hi, when i try jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore HelloWorld-release-unsigned.apk alias_name i get the error jarsigner cannot be recognised as an internal or external command. i’ve added C:\Program Files (x86)\Java\jre1.8.0_73\bin; to the environment variables which is how keytool worked but i dont understand why it is not working now
amigos tengo mucho tiempo tratando de generar mi apk para android y no e logrado hacerlo, ya e intentado muchos métodos e incluso tengo lo requerido en este tutorial y las variables en el PATH, sera q pueden darme una referencia de algún vídeo o foro en el cual pueda ver mas a fondo y solucionar los errores o si no es mucha molestia q uno de ustedes me preste la ayuda necesaria para configurar bien el ámbito de trabajo y que pueda generar apks de manera exitosa?
Gracias!
@LuiisMS adjunta alguna captura de pantalla o mensaje de error para que te podamos ayudar. Cuéntanos si estás en Windows, Linux o Mac y que versión de Ionic estás usando.
amigo, gracias dios pude solucionar mi problema, para lo que tengan alguna pregunta sobre lo q andaba buscando, puede preguntarme y sabre responder tambien para que puedan generar su apk de forma exitosa asi como ya pude hacerlo!!
gracias x la pronta respuesta y pues estaré atento porque soy nuevo en este mundo ionico y necesitare de mucha ayuda, ya que estoy construyendo una app para mi proyecto de ingenieria como ya lo dije y es sencillo, pero para mi un poco dificil por ser nuevo!!
SALUDOS (Y)