Veeru
Veeru

Reputation: 4936

Android app submisson. Easy way to remove logging?

Android app submission says, remove any logging before submission. Have a few question on this one

  1. Is System.out.println considered as logging? How can I disable it across the app without having to remove it on by one
  2. Tried android:debuggable="false" inside manifest, but eclipse says "Avoid hardcoding the debug mode; leaving it out allows debug and release builds to automatically assign one"
  3. I have some third party jar files that shows Log statement when I test my app. How can I remove them, considering I don't have the source.

Suggestions are highly appreciated.

Upvotes: 3

Views: 987

Answers (1)

programmer33
programmer33

Reputation: 652

I'm sure you've come across the fact that you can do the if(GLOBAL_VALUE) trick, because your logs are already there!

Therefore, my suggestions is to use Proguard; http://developer.android.com/tools/help/proguard.html

The following proguard.cfg chunk instructs to remove Log.d calls.

-assumenosideeffects class android.util.Log {
    public static *** d(...);
}

You can do it for other calls like Log.i, Log.e, etc based on the value you put there!

As for your Jar, if it is referencing the Android Log system, ProGuard should take care of that.

Upvotes: 2

Related Questions