Here's how to emulate Cordova Plugins on a website

I’ve seen several posts where people are having trouble debugging their apps in a browser. Not having the plugins is a real impediment to this.

Several years ago I ran across a cordova emulator on github and I’ve no idea why this hasn’t taken off.

Anyway, it works like this: You place a cordova.js file in the root of your app directory on the server (DO NOT place this file in the directory on your local machine as it will cause your app to fail when you build the actual app). Then you create a subdirectory for the plugins to be emulated. The project on github comes with a few basic plugins emulated but it’s easy to add new ones yourself… most of the ones I’ve done have been less than 20 lines of code. It’s pretty straight forward actually.

Once everything is setup you can debug your app, get the response from the plugin that you would want and go from there. It really does make debugging go so much easier.

The link to the emulator is here: Cordova Emulator on GitHub