I am using this command to open up my app in the browser: cordova serve
but it does not refresh itself when I update my code. How can I do that?
I have tried to use phonegap serve
instead which has a live reload but it keeps sending me alerts and crashes my browser.
So, if you can please tell me how can I solve either of the two issues that will be wonderful.
Install the cordova module using npm utility of Node. js. The cordova module will automatically be downloaded by the npm utility. On OS X and Linux, prefixing the npm command with sudo may be necessary to install this development utility in otherwise restricted directories such as /usr/local/share .
You could try the Cordova Browsersync plugin. Instructions to use the plugin are in the plugin's repo.
Once you add this plugin using cordova plugin add cordova-plugin-browsersync
, you can simply use cordova run -- --live-reload
to start live reload. Note that this also enables syncing scrolls and clicks if you have multiple devices.
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