I'm using Phonegap Build online for testing devices installed app and Chrome/Ripple for testing my app locally. Currently using the following to set the global web service reference pointer so I don't have to keep switching this string when deploying to phonegap. Now I would like to add a third "test.domain.com" so I can test the app to a test web service database so I can do test transaction before making my app live. Looking for some trick or tips on dealing with test environments and live setting variables in a phonegap app. Any pointers? In this example I used "hostname" to decipher environment.
if (window.location.hostname == "127.0.0.1") //Dev
If you were using the CLI, there'd be many options available, but a pure PGB option... hmm.
Simplest option might be to have a settings screen where you can toggle test/prod status. I built an app for a client that did that -- the option to change the setting was buried and had to be enabled a certain way, but it worked. Requires manual intervention on your part (not automatically determined), but should work in a pinch. (In the app we built, the setting was saved locally, so you only had to do it once.)