开发者

Is there a shortcut to remove all Log statements from an Android project made in Eclipse?

I want to remove all the Log statements that I had added when I was making my android project. This is because I am now shipping the final project to my client.

Is there a shortcut which will automatically find all the Log statements an开发者_StackOverflow中文版d delete them?

This would spare the labor of going to individual Log statements and then deleting them.


Use Eclipse, type android.util.Log, place your cursor on the word Log, and press ctrl+shift+g or cmd+shift+g to find all references to it.


Yes, you can use ProGuard to strip them automatically. See Remove all debug logging calls before publishing: are there tools to do this?


build.gradle

buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' }

proguard-rules.pro

-assumenosideeffects class android.util.Log { *; }

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜