Detect debug mode? (may be cordova question)

Hi guys,

Does any one know whether it is possible to detect whether the app is in debug mode?
My app is using Google Analytics code and I want it to bypass if debug mode.

Hm… It’s a good question. Probably there is a setting on cordova/ionic to do this.

I’d bet on config.xml preferences.

Another way (workaround?) to achieve this is use a task manager like grunt, to inject the Google Analytics only on your production build.

Bump. I can’t find documentation anywhere for what the --debug flag actually does, let alone how to create code paths that depend on it.

I’ve actually made a cordova plugin (for android only, ios later) to return whether it’s a debug or for production release.

Here’s the link.

1 Like