How to check if APK is signed or “debug build”?

后端 未结 10 1955
我在风中等你
我在风中等你 2020-11-29 16:34

As far as I know, in android \"release build\" is signed APK. How to check it from code or does Eclipse has some kinda of secret defines?

I need thi

10条回答
  •  情书的邮戳
    2020-11-29 16:57

    Answered by Mark Murphy

    The simplest, and best long-term solution, is to use BuildConfig.DEBUG. This is a boolean value that will be true for a debug build, false otherwise:

    if (BuildConfig.DEBUG) {
      // do something for a debug build
    }
    

提交回复
热议问题