I used ionic serve and got the below response to which I did not think twice and selected localhost. However now I want to use option 1. Ionic has remembered my selection such that ionic serve never allows me to select anymore and uses localhost...
How can I change this so that ionic serve uses the first option?
Multiple addresses available.
Please select which address to use by entering its number from the list below:
1) 192.168.2.10 (en0)
2) localhost
Address Selection:
There is a file called ionic.config which you can modify with this setting. On Mac this file is at ~/.ionic. On a PC it can be found at c:/users/username/.ionic. Inside you'll see something like this which you can edit the ionicServeAddress value.
{
"ank": "...",
"versionCheck": 1413143560174,
"ionicServeAddress": "localhost"
}
just type ionic address command and you get the option to select your IP address again.
OR
you can explicitly select your address and port when you run ionic serve
by using the --address and --port options. Like this:
ionic serve --address IP_address --port port
example : ionic serve --address 192.168.1.129 --port 8101
Things to note
--address the default port(8100) is used instead.ionic address command instead.This has been fixed in version 0.6.1
Update to the latest version by running npm install -g generator-ionic and then run yo ionic inside your current project and select Y when Yeoman asks if you would like to overwrite your Gruntfile.js