Deployed app - Connection refused


Hi, I have just created my first great Ionic app.
I have tested it with the command ionic run android -l -s -c and it runs great only until I stop the webserver on the mac.
How should I deploy completely the app without looking for local web server?

I’ve googled around looking for what I am missing, but I can’t understand!


The -l -s -c flags are for the ionic live reload feature that means you don’t need to keep re-building and re-deploying to your device or sim after each code change - but this requires the local ionic web server running. To deploy to a device without the webserver running just run ionic run adroid


I tried these flags (without knowing them) because I followed this answer App crashed with white or black screen on Galaxy s4 when repeatedly restarting the app several times
If I simply try ionic run android I get only a black screen on Samsung S4 and a fast flash white screen.


I’ve only been deploying to iOS so won’t be able to help too much I’m afraid.

I would try the following:

Make sure you’re running the latest version of ionic CLI
Update whatever Android SDKs you need in order to build for Android
Test with the most basic ionic app and see if that runs on your device e.g. ionic start myproject


I have just learned that with Chrome I can inspect javascript log on the device… one step at a time.
The problem seems that the app can’t find the templates in the asset folder

Failed to load resource file:///templates/box/detail.html

I am googling around to find out the reason.


The problem is caused by templates page in the subfolder of the default templates one. I am using Diego Netto generator
How can I keep my subfolder?


Ok… I am sorry: I had to use the relative path for templates files.
Thank you.


Good that you got to the bottom of it!