Is there a way to disable ACRA when debugging locally?

836 views
Skip to first unread message

Tal Weiss

unread,
Jun 20, 2012, 1:35:17 AM6/20/12
to acra-d...@googlegroups.com
I'm USB connected to the phone and logcat is flashing in an Eclipse window.
Can ACRA be automatically disabled in this situation from spamming my nice Google doc?

Thanks,

Tal.

Richard Critten

unread,
Jun 20, 2012, 6:53:50 AM6/20/12
to acra-d...@googlegroups.com
In your MyApplication class onCreate() method, instead of

    ACRA.init(this);

try this

    if (!BuildConfig.DEBUG) ACRA.init(this);

BuildConfig.DEBUG is created by the Android build system and set to false when you build a release package.

This works for me.

Tal Weiss

unread,
Jun 21, 2012, 3:55:09 AM6/21/12
to acra-d...@googlegroups.com

Stefano IceCubeR

unread,
Apr 10, 2013, 5:15:21 PM4/10/13
to acra-d...@googlegroups.com
I'm trying to have a debug formKey:


@ReportsCrashes(formKey = "<production key>")
public class JCApplication extends Application


@Override
    public void onCreate() {
        super.onCreate();

        // The following line triggers the initialization of ACRA
        ACRA.init(this);
        if (Utils.isDebugBuild(getApplicationContext())) {
            ACRAConfiguration ac = ACRA.getConfig();
            ac.setFormKey(getString(R.string.debug_form_key));
        }
    }

so the dev log doesn't mix with production!

p.s. seems that BuildConfig.DEBUG generation had some problems...
http://code.google.com/p/android/issues/detail?id=27940
but seems fixed from adt r20
Status:  Released
Target-r20

Stefano


Reply all
Reply to author
Forward
0 new messages