Detect debug mode? (may be cordova question)


#1

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.


#2

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.


#3

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.


#4

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.