Chapter 4. Tools
If your application is making requests to a server, you might be using some type of log to check whether or not your requests are successful. Unfortunately, those logs don’t get removed when you build the final APK (Android application package file). Removing logs is important to keep the logcat output as clean as possible. Leaving log statements in could also expose you to unintentional disclosure of sensitive information. In this hack, I’ll show you how easy it is to remove logs for your market release.
Developers have their own technique preferences for removing logs from the final release. Some prefer doing something like the following:
From my point of view, the best way to remove logs is to use the ProGuard tool. If you’ve never used ProGuard, let me introduce it with the following quote from the Android documentation (see section 18.2):