Shinon Chan Shinon Chan - 3 months ago 16
Android Question

Meteor cordova on Android building app

I am trying to test my app on my phone. I did this:

meteor build <bundle path> --server <host>:<port>


I took the
aligned.apk
from the build folder and put it on my phone but it gave an error when I tried to install.

I tried
brew install android-sdk
and downloaded the latest apk, but that still didn't work.

I am not sure what I am supposed to do. Please help.

Answer

Ok, dug a little deeper, here's what worked for me. See here for android: https://github.com/meteor/meteor/wiki/How-to-submit-your-Android-app-to-Play-Store

specifically:

keytool -genkey -alias your-app-name -keyalg RSA -keysize 2048 -validity 10000

cd ~/build-output-directory/android/
jarsigner -digestalg SHA1 unaligned.apk your-app-name

~/.meteor/android_bundle/android-sdk/build-tools/20.0.0/zipalign 4 unaligned.apk production.apk

Then install the "production.apk" to your device.