I'm trying to run the ionic project on browser but the default port 8000 is already in use.
I need to change the port
I'm using this command:
ionic run browser --port 8002
but its not working.
The documentation says the port
options are --port|-p
Thanks
By default, ionic serve boots up a development server on localhost . To serve to your LAN, specify the --external option, which will use all network interfaces and print the external address(es) on which your app is being served. Try the --lab option to see multiple platforms at once. ionic serve uses the Angular CLI.
To run your app, all you have to do is enable USB debugging and Developer Mode on your Android device, then run ionic cordova run android --device from the command line. Enabling USB debugging and Developer Mode can vary between devices, but is easy to look up with a Google search.
ionic build uses the Angular CLI. Use ng build --help to list all Angular CLI options for building your app.
Ionic Labs allows you to preview your application working on the Android and iOS at the same time on the browser on the very same screen. This allows you to visualize changes on your app on all platforms at the same time so that you can quickly catch little quirks here and there.
Try ionic platform add browser
before,
or
ionic serve -p 8002 --dev-logger-port 8103
instead...
When running 2 ionic apps at the same time, it's not enough to specify a new port for the second app, you also need to specify a new port for live reload and dev logger or they will conflict with the first app:
ionic serve -p 8101 -r 8102 --dev-logger-port 8103
Otherwise, you'll get connection error. Make sure firewall allows all those ports you use.
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