A powerful “feature” for debugging in sim or on device is to, during development/debugging, point config.xml at a web server for the application content, so that you just need to update the content, restart the app, and boom, you can quickly test your app in a real environment rather than in browser.
With “cordova serve” and “prepare”, we are half way there. I wonder if we could add a feature, in the CLI then exposed to the GUI, that provides maybe a special param on build that will temporarily point the config.xml at the serve location. Then the developer can use the prepare and serve commands as-is and get on-device or in-sim remote debugging with quick refreshes. Ultimate awesome would be for somehow have the device auto-refresh the app, but that is a separate story…
Acceptance Criteria
In the CLI, the developer should be able to provide a parameter on build to have the config.xml automatically pointed at the "cordova serve" location (usually http://localhost:8000)
What happens if that port is in use? How do we know what location to point to?
Developer should have an option in the GUI to trigger a debugging session with "remote debugging"
This would trigger the build with the CLI parameter to point to the serve location
If not already running, call Cordova serve
Deploy application to device/simulator
The developer should be able to make changes to their code outside of the config.xml and be able to trigger cordova prepare to update the hosted content
The GUI should be able to monitor for changes to config.xml and:
update the "temporary" config.xml appropriately on the next invocation of prepare
I use location.reload() in the inspector tab after, running prepare, to avoid re-opening the app.
Maybe triggering this command automatically from the "prepare" could work as an auto-refresh?
Description
A powerful “feature” for debugging in sim or on device is to, during development/debugging, point config.xml at a web server for the application content, so that you just need to update the content, restart the app, and boom, you can quickly test your app in a real environment rather than in browser.
With “cordova serve” and “prepare”, we are half way there. I wonder if we could add a feature, in the CLI then exposed to the GUI, that provides maybe a special param on build that will temporarily point the config.xml at the serve location. Then the developer can use the prepare and serve commands as-is and get on-device or in-sim remote debugging with quick refreshes. Ultimate awesome would be for somehow have the device auto-refresh the app, but that is a separate story…
Acceptance Criteria