Ionic4 capacitor android livereload?

三世轮回 提交于 2020-02-02 11:01:58

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!