[Mobile]: iOS app still connects to localhost:3000

I am building the mobile app with the following commands:

meteor build ../../mobile-version --mobile-settings mobile-settings.json --server="http://10.0.1.4:3000"

The weird thing for me is that in the console output of the ios app I still see that it tries to connect over localhost:

ERROR whitelist rejection: url='http://localhost:3000/sockjs/info?

Why doesn’t the built app pick up the --server option? What am I missing?

Maybe removing the quotes and using just:

--server=http://10.0.1.4:3000

It was actually not the quotes, was happened was that cordova made a hot code push from the server, this overwrote all the settings.

What needed to be done is start the server with the --mobile-server 10.0.1.4:3000 flag, otherwise the server pushed the wrong ddp connection settings down to the app.

I’ve been having problems with this too. It looks like a known issue:

And how do you start the server like this? Are you using mup for the deploy?

No currently we use our own github hooks and automatically deploy the latest version to our server, as we are still in development mode, that is sufficient.

We haven’t looked closer how to do this with mup, wonder if it is possible to put it directly into the settings.json?

@aranir, in case you would like to use mup in the future for deploying your Meteor app to Android, I’ve successfully used mup to deploy to AWS, and then deployed my Android app. However, during mup deploy, I had to remove the Android platform using meteor remove-platform android before mup deploy could proceed. Otherwise, you’ll get the error described here: https://github.com/arunoda/meteor-up/issues/629
Once you’ve done the mup setup and deploy, you can then do meteor build ../../mobile-version --mobile-settings mobile-settings.json --server=http://YourServer to create your Android app.