I recently started learning Ionic Framework. You can use Ionic serve
command inside the project to run a livereload server. Once in a while it asked whether server should run on localhost
or system ip
. I chose second option. Now It doesn't ask anything and directly runs on system's ip
.
How do reset this automatic behaviour?
I tried looking into serve.js
file in ionic-cli
project but no luck.
ionic serve uses the Angular CLI. Use ng serve --help to list all Angular CLI options for serving your app. See the ng serve docs for explanations.
Details. Easily spin up a development server which launches in your browser. It watches for changes in your source files and automatically reloads with the updated build. By default, ionic serve boots up a development server on all network interfaces and prints the external address(es) on which your app is being served ...
ionic serve run the app and then ctrl + c to cancel.
If you want to specify the ports themselves, you can pass additional option arguments when you run ionic serve like — port|-p for an specific web server port. If you try ionic serve -p 8200 -i 35730, the app runs perfectly with the custom web server and livereload port in your browser.
It's not necessary to edit the code. You can switch between addresses with the command ionic address
. You'll then get options like this:
Please select which address to use by entering its number from the list below:
1) 10.0.1.7 (en1)
2) localhost
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With