Last active
June 28, 2017 11:58
-
-
Save luizcarraro/6562edc3d50123653e2ddf1b8d9a689a to your computer and use it in GitHub Desktop.
Android build with cordova
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# $1 = staging, production or development | |
BUILDPATH=cordova/platforms/android/build/outputs/apk/ | |
echo -e '\033[01;32m >>>>>>>>>>>>>>>>>>>>>>>> ETAPA 1/4 > APLICANDO CONFIGURAÇÕES ANDROID AO PROJETO \033[00;37m' | |
sed -i '' 's/ios/material/g' ember-cli-build.js | |
echo -e '\033[01;32m >>>>>>>>>>>>>>>>>>>>>>>> ETAPA 2/4 > FAZENDO BUILD PARA ANDROID \033[00;37m' | |
ember cordova:build --environment=$1 --platform=android | |
echo -e '\033[01;32m >>>>>>>>>>>>>>>>>>>>>>>> ETAPA 3/4 > ASSINANDO O ARQUIVO COM JARSIGNER .APK \033[00;37m' | |
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore "$BUILDPATH"yourapp.keystore -storepass yourapp "$BUILDPATH"android-release-unsigned.apk alias_name | |
echo -e '\033[01;32m >>>>>>>>>>>>>>>>>>>>>>>> ETAPA 4/4 > OTIMIZANDO ARQUIVO .APK COM ZIPALIGN \033[00;37m' | |
/usr/local/Cellar/android-sdk/24.0.2/build-tools/22.0.1/zipalign -v 4 "$BUILDPATH"android-release-unsigned.apk "$BUILDPATH"yourapp"$1".apk | |
echo -e '\033[01;32m PARA ACESSAR A .APK, EXECUTE O SEGUINTE COMANDO: cd '"$BUILDPATH"' \033[00;37m' | |
open "$BUILDPATH" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment