Meteor cordova on Android building app

2019-05-26 22:09发布

问题:

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.

回答1:

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.



回答2:

Have you read this?

https://www.meteor.com/try/7

For iOS you need to install Xcode which is about 2GB (XCode)

  1. meteor install-sdk ios
  2. meteor add-platform ios
  3. meteor run ios (Simulator) or
  4. meteor run ios-device (Device) or
  5. meteor run ios-device --mobile-server my_app_name.meteor.com

Try to read upon this: https://github.com/meteor/meteor/wiki/Meteor-Cordova-Phonegap-integration

and this: http://www.sitepoint.com/beginners-guide-mobile-development-meteor/