dsebao
5/16/2016 - 5:04 PM

Cordova Android App tutorial for macosx

Cordova Android App tutorial for macosx

#create app
cordova create appname com.appname.workshop Appname

#navegate to folder
cd appname

#add platform
cordova platforms add android

#add plugins
cordova plugin add cordova-plugin-device
cordova plugin add cordova-plugin-console

#build debug mode
cordova build android

#crear firma inside platforms/android/
keytool -genkey -v -keystore appname.keystore -alias myName -keyalg RSA -keysize 2048 -validity 10000

#Create a ant.properties file inside platforms/android/
key.store=/path/to/keystore/myReleasekey.keystore
key.alias=alias_name

#build release mode
cordova build android --release

#copy the keystore in apk

#Set android ddebug false in platforms/android/AndroidMainifest.xml
<application android:debuggable="false"

#sign the app with jarsigner inside apk folder
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore appname.keystore android-release-unsigned.apk aliasname

#Align app using zipalign inside cd platforms/android/build/outputs/apk
/usr/local/Cellar/android-sdk/24.4.1_1/build-tools/20.0.0/zipalign -v 4 android-release-unsigned.apk appname.apk