Issue
So, I get the error "Failed to load webpage with error: Could not connect to the server" when I try to livereload my app on iOS. I have tried everything I can find on the topic. I've spent all day trying things. So I realized that maybe there is something needed that I don't understand. Here are the things I tried: "ionic cordova prepare iOS", "ionic cordova build iOS", "ionic cordova run ios --address=0.0.0.0 --debug --consolelogs -l", "
<allow-navigation href="http://localhost:8080/*" />
<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
", "cordova plugin rm cordova-plugin-ionic-webview cordova plugin add cordova-plugin-ionic-webview".
I thought maybe someone might have a different idea, or questions that will lead to the solution.
The app opens, and I get that message as an alert on my splash screen, but then it never moves past the splash screen.
Something I just thought of, if I use "ionic cordova run ios --address=0.0.0.0 --debug --consolelogs -l", do I need to use the ip address of my computer?
Any other suggestions or questions?
Solution
The docs will help you here.
Firstly, you will need to run the server. Do this by running
ionic serve
This should give you something like this at the end:
App running at:
- Local: http://localhost:8100/
- Network: http://192.168.x.xxx:8100/
If you are wanting to run this on an actual iOS device on your network, then you will need to use your servers ip address. eg. 192.168.x.xxx.
Then you should be able to run the cordova livereload like this:
ionic cordova run ios --livereload-url=http://192.168.x.xxx:8100
Hopefully that works for you.
Answered By - CUGreen
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.