简体   繁体   English

如何在运行时知道 Kony 应用程序是在调试模式还是发布模式下构建的

[英]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.使用 Chrome 调试器后,我找到了解决方案。 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.
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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