简体   繁体   中英

BuildConfig.DEBUG override to true for release build?

是否有任何方法(至少是暂时的)告诉ADT,即使对于发行版,也将BuildConfig.DEBUG保留为TRUE?

At that point, you should just create your own constant like

public class MyConfig {
    public static final boolean DEBUG = true;
}

BuildConfig really is meant to tell if it is a debug or production release.

Note that you can modify your own constant from outside the code. For example, on Linux or OSX:

#!/bin/bash
cat MyConfig.java | sed -e 's/DEBUG = true/DEBUG = false/g' > newMyConfig.java
mv newMyConfig.java myConfig.java
ant release

This simply rewrites the config via an outside source.

I was facing the same issue as everytime I was running the project as android application it used to open in debugger mode but then the problem was solved.

-If you are working in eclipse you must be using Java EE perspective -Instead just select Java perspective.

-Clean your app. -uninstall the app from the device. -Restart your device (Just like that so that no cache is stored) -Run your app.

The debugger mode won't show up this time. Copy the apk generated in your bin folder and try it out on other devices as well

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