Skip to main content

How to remove log completely in release version in Android

You can use ProGuard to remove completely any lines where a return value is not used, by telling ProGuard to assume that there will be no problems.
The following proguard.cfg chunk instructs to remove Log.d, Log.v and Log.i calls.
-assumenosideeffects class android.util.Log {
    public static *** d(...);
    public static *** w(...);
    public static *** v(...);
    public static *** i(...);
}
The end result is that these log lines are not in your release apk, and therefore any user with logcat won't see d/v/i logs.

ref. http://stackoverflow.com/questions/5553146/disable-logcat-output-completely-in-release-android-app

Comments