简体   繁体   中英

Ionic4 capacitor android livereload?

Is there posibility to run ionic4 app with capacitor on android device with livereload? I was looking for answear for a few hours now without a luck. Please help.

If using a recent version of @ionic/cli , there is a command now ionic capacitor run android --livereload --external

You can do it manually too (if not using ionic CLI or using an old version that doesn't have the mentioned command) by adding the server object to the capacitor.config.json file, just use the url of your live reload server

"server": {
    "url": "http://192.168.1.33:8100"
}

You can use the following command to livereload without specifying the IP address:

ionic capacitor run android --livereload --external

The "--external" flag hosts the development server on all network interfaces (like adding --address=0.0.0.0) [1] . The "--livereload" flag can be shortened to "-l".

After executing the command, open your native IDE and run the app on the device or simulator. You will know that the livereload server is running when you see the message "Using app server http://xxxx:8100 " (your IP address).

You can use the ionic cli for this:

ionic capacitor run android --livereload

For example.

Source: https://ionicframework.com/docs/cli/commands/capacitor-run

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM