问题
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.
回答1:
You can do it 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"
}
回答2:
You can use the ionic
cli for this:
ionic capacitor run android --livereload
For example.
Source: https://ionicframework.com/docs/cli/commands/capacitor-run
回答3:
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://x.x.x.x:8100" (your IP address).
来源:https://stackoverflow.com/questions/53328647/ionic4-capacitor-android-livereload