How to remove all debug logging calls before building the release version of an Android app?

前端 未结 27 1498
有刺的猬
有刺的猬 2020-11-22 07:39

According to Google, I must \"deactivate any calls to Log methods in the source code\" before publishing my Android app to Google Play. Extract from section 3 of th

27条回答
  •  礼貌的吻别
    2020-11-22 08:26

    I would consider using roboguice's logging facility instead of the built-in android.util.Log

    Their facility automatically disables debug and verbose logs for release builds. Plus, you get some nifty features for free (e.g. customizable logging behavior, additional data for every log and more)

    Using proguard could be quite a hassle and I wouldn't go through the trouble of configuring and making it work with your application unless you have a good reason for that (disabling logs isn't a good one)

提交回复
热议问题