I followed the Meteor Tutorial to get a taste of deploying a simple App to iOS via Cordova. When I get to Running on mobile I have no problems running in the iOS simulator or on a physical device (iPhone 6 w/iOS9).
However, I’ve deployed the app using:
meteor deploy <appname>.meteor.com
Yet when I run…
meteor run ios-device --mobile-server <appname>.meteor.com
… it does not appear that the App is loading any resources from the remote server: The App always starts with an empty todo list, even though I’ve added items via a desktop browser at appname.meteor.com
I’ve tried this both with Meteor 126.96.36.199 and Meteor 1.2-rc.16.
This is Xcode 7.0 with an iPhone 6 iOS 9.0
The --mobile-server option should affect where the DDP connection is made to, and where new app versions are downloaded from. Files are always loaded from the local device, which is what meteor.local refers to.
I’m not sure what is going on in your specific situation. What you describe should be enough to connect to your deployed app. Does this also happen when running on the simulator or on an Android device?
I am experiencing the same issue. The first time I used --mobile-server it worked perfectly, however when I need to use a different server, the flag doesn’t work. The first use seems to cache the URL somewhere, and uses that as the default location.
I found the easiest thing was to just always delete the .meteor/local/cordova-build and then re-run meteor run ios-device.
I also noticed quirks in the Xcode simulator where you would have to “reset” the simulator in order to truly get the latest version of the App installed. And on a physical device, deleting the previous version before running a debug build is probably wise.
I spent quite a few hours trying to figure this out.
With 188.8.131.52 I was able to build the app for android ( apk file ) and install it on android . After a lot of googling and reading posts ,it came down to the following : build the app using meteor build buildfolder --server=http://server:port
and running the server with the option --mobile-server=http://server:port
I have seen posts where some people got it to work by setting ROOT_URL or other env variables. None of those worked for me. Only thing that worked is the --mobile-server option passed while starting the server.
I was building the app on a vm and never really tried to use the simulator etc and this app did not have any oAuth plugins.
Another app with the same meteor version - 184.108.40.206 , has oAuth due to the accounts-google and accounts-facebook , now this time building on Mac ( latest OS ) and when run with the meteor run ios --mobile-server server:port does not get past the splash screen - some issue with the oAuth … allright , i run it on device due to the oAuth issue of not being able to run it on simulator with meteor run ios-device --mobile-settings server:port , i get past the splash screen on the device but the records are not beign rendered or does not seem like the app on the device is connecting to the server when run from the xcode.
Also in the mix i tried to port to released 1.2.x … spent quite few hours , ran into issues related to ionic, ionic tabs not rendering , iron router not rendering the templates or not finding the templates missing ejson etc… and dropped the idea of porting the app to 1.2.x …
My experience working with Meteor so far has been trial and error , broken documentation and several issues or difficulties building apps for mobile devices ( it is different thing building pure web apps - much straight forward) … We are so far nearing our planned launch date for our apps and continuing to work with meteor … Hopefully in future will upgrade to something more stable
Writing this , while i am still trying to figure out how to get my app launched on the device from Xcode to communicate with the remote server -lol