Thursday, October 29, 2020

What is ionic live reload

When active, Live Reload will reload the browser or Web View when changes in the app are detected. This is particularly useful for developing using hardware devices.


Live Reload is a conflated term. With ionic serve, Live Reload just refers to reloading the browser when changes are made. Live Reload can also be used with Capacitor and Cordova to provide the same experience on virtual and hardware devices, which eliminates the need for re-deploying a native binary.


To use Live Reload with Capacitor, make sure you're either using a virtual device or a hardware device connected to the same Wi-Fi network as your computer. Then, you'll need to specify that you want to use an external address for the dev server using the --external flag.


ionic capacitor run ios -l --external

ionic capacitor run android -l --external



For Android devices, the Ionic CLI will automatically forward the dev server port. This means you can use a localhost address and it will refer to your computer when loaded in the Web View, not the device.


ionic cordova run android -l




references:

https://ionicframework.com/docs/cli/livereload


No comments:

Post a Comment