How to run my deployed app


#1

Hello,

I have created an meteor app, and deployed it using meteor deploy DOMAIN.

Is it possible to use my app just ‘wireless’ and everywhere, and not only when I used meteor run android-device --mobile-server DOMAIN, and while connected to the computer?

Or should I deploy my app to an VPS first?

I hope you understand my question

Yours,
L


#2

Hey Ludo, this is a huge PITA to figure out, but I can conform it does actually work for Android.

If you haven’t already, start here: https://github.com/meteor/meteor/wiki/Meteor-Cordova-integration

On the right of the wiki are “Pages (47)” also expand that, and read everything there too.

Bottom line, you’ll have to do alot of work and reasearch. The tutorial page glosses over alot of the complexity.

Yes, you can run the app locally. Either in a browser, or on a phone pointed to localhost, or on a phone pointed to a public server.

Configure you app’s mobile-config.js with App.accessRule('*'); (Google it)

If you get stuck, look in github for issues. There are some unresolved bugs out there, that look like the App.accessRule() issue.

I have these bash scripts in my phone app folder for testing:

# Run in browser
meteor run --settings settings.json
# Run on USB attached phone (you need Android SDK.  google it)
meteor run android-device --settings settings.json
# Run app on USB attached phone pointed to deployed "staging" server
meteor run android-device \
  --settings ./stage-settings.json \
  --mobile-server https://stage.example.com:443 \
  --verbose
# Build APK to put in Play store.  'android' is a build directory
meteor build android \
  --mobile-settings prod-settings.json \
  --server https://prod.example.com:443 \
  --verbose

# Your apk may be somewhere else.  This is for crosswalk
cd android
cp android/project/build/outputs/apk/android-armv7-release-unsigned.apk ./release-unsigned.apk

# Sign the APK (google it)
jarsigner -verbose \
  -keystore ./keystore \
  -storepass keystorePass \
  -sigalg SHA1withRSA \
  -digestalg SHA1 \
  release-unsigned.apk \
  phone.example.com

# This may break.  Run android sdk installer to get tools (google it)
rm -f release-signed.apk
$ANDROID_HOME/build-tools/23.0.2/zipalign 4 release-unsigned.apk release-signed.apk

# Upload to the play store

Good luck!


#3

Hey Michael,

Thanks for the response, I have seen that github page, but didn’t notice te 47 pages.
Basicly what you are saying is:

It is not possible to test my app, without having it attached to my phone, and without putting it in the play store?

Yours,
L

EDIT:
GOT IT FIXED! thanks to:


Thanks Michael


#4

Hey Ludo,

It’s alot to digest.

It is not possible to test my app, without having it attached to my
phone, and without putting it in the play store?

Based on my experience, it is possible.

  1. I deploy the app to a public “staging” server.
  2. Delete the app from the phone
  3. Connect phone via USB and run this command
# Run app on USB attached phone pointed to deployed "staging" server
meteor run android-device \
 --settings ./stage-settings.json \
 --mobile-server https://stage.example.com:443 \
 --verbose
  1. Disconnect the phone. My app runs pointed to stage.example.com

What’s not explained very well, but there’s a github issue about is that
when the phone is connected, it seems to get app code pushes from the dev
computer, but run against the public stage. There are alot of fiddly
pieces, so it’s alot to bite off. IMHO, there is a large gap between
marketing and documentation on this feature.

Anyways Ludo, hope this helps you :slight_smile: Good luck with your project!