1/1/2024 0 Comments Ionic livereload android![]() Of course you need to remember to clean the project when you finish and use the device’s files. I we work a little bit we can automate this process and turn it into a trivial operation, but at least now I feel very comfortable. I now that this little hack may looks like something difficult but we need less than a minute to set up the environment and we will save thousand of seconds in the development process. (I’ve got one tearDown.sh file with this commands)Īnd that’s all. We’re going to use de device’s Cordova’s Webkit one, and also if we open our browser it will crash because cordova.js is present now and our local host isn’t a real device.Įach time we need to redeploy the application to the device (new plugin for example) we need to remember to quit the symlinks, and redeploy. We’re using this parameter to not to open our local browser. Now can start the application’s server in our host with: platforms/android/assets/www/cordova_plugins.js ![]() (I’ve got one setUp.sh file with this commands) “cordova run android –device” will generate the file to the platform and deploy them to the real device, but as well as we’re going to use this file from our local server (in www), we need to create a set of symlinks in our www folder. But we need to keep in mind that our device will use the cordova.js from our local server, and not from its filesystem. Now we need to deploy the application to our device:Įach time we add/remove one plugin we need to redeploy to the device. Now we change our config.xml to use our local server instead of device’s files: We can change it manually adding to our index.html (this snippet suppose that your host is 192.168.1.1 if it’s a different one use your local IP address): “ionic serve” do it automatically but it thinks that we’re going to use it with your host browser. If we use on iPhone we only need to change “adroid” to “ios”.įirst of all we need to prepare our index.html to enable auto-reload. In this example I suppose that we’re using one android device. The “slow” phase turns into a “fast” phase. If we change anything in the static files (html, js, css) our app will be reloaded automatically. With this approach we only need to deploy the application to the real device when we want to add/remove one plugin.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |