简体   繁体   中英

How to know at runtime whether a Kony app was built in debug or release mode

I'd like to be able to determine programmatically whether the app was built in debug or release mode. I'd like to be able to write something like:

if(isDebug) {
    //do domething.
}
else {
    //do something else.
}

After using the Chrome debugger I was able to unearth the solution. There's a constant set during the build process which you can query in order to determine whether the app has been built in debug or release mode.

if(kony.constants.RUNMODE === "debug" || appConfig.isDebug) {
    //do domething.
}
else {
    //do something else.
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM