- DelphiTools - https://www.delphitools.info -

Debugging PhoneGap/Cordova apps on the Desktop

[1]If you’ve tried building PhoneGap [2]/Cordova [3] apps, be it in Object Pascal via Smart Mobile Studio [4] or directly in JS, you’ll quickly have realized that debugging on the devices, even with remote debuggers and emulators, isn’t always convenient.

Being able to debug in a desktop browser would be so much more convenient, eh?

The most commonly recommended way to do that is via Ripple [5], a Chrome plugin, which is indeed pretty, but IME proved quite buggy and heavy (meaning that Chrome debuggers would spend more time reporting stuff buried deep in ripple.js than in my own code).

Enter phonegap-desktop [6], an open source project by Jonathan Prince, which is essentially just a phonegap.js library that exposes the PhoneGap API, and allows you to provide fake device data just by writing in a json file. Simple, no-fuss.

To use it with a SmartMS project, just copy the “phonegap-desktop.js” file in the bin subfolder of a project, rename it to “phonegap.js“, et voilĂ ! you can then run your app in Chrome or FireFox as usual. And when building the zip for Phonegap Build [7], just don’t include that file.