在发布Android应用程序完全禁用LogCat中输出? [英] Disable LogCat Output COMPLETELY in release Android app?

查看:1130
本文介绍了在发布Android应用程序完全禁用LogCat中输出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关闭掉的我的的释放一个应用程序推向市场之前,应用程序的LogCat中输出很简单。我也知道该如何选择地过滤LogCat中的信息通过标签和/或ID为我自己调试方便。

Shutting off my own app's LogCat output before releasing an app to the market is straightforward. I also know how to selectively filter LogCat message by tag and/or id for my own debug convenience.

但现在我感兴趣的东西,可能要困难得多:禁用所有LogCat中输出,其中包括与放大器;尤其是来自第三方的服务,如TtsService,GoogleLoginService等来了

But now I am interested in something that may be much more difficult (perhaps impossible?): Disable all LogCat output, including & especially those coming from 3rd-party services like TtsService, GoogleLoginService, etc.

这可能吗?

要进一步澄清:我的没有的兴趣筛选出的消息为自己。我在禁用第三方消息谁下载从Android Market我的应用程序,而感兴趣。这可能吗?

To further clarify: I am not interested in filtering out messages for myself. I am rather interested in disabling 3rd-party messages for whoever downloads my app from the Android Market. Is this possible?

推荐答案

您可以使用 ProGuard的以完全除去其中一个返回值不使用时,通过告诉ProGuard的任何行假设不会有问题。

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.

下面proguard.cfg块指示删除Log.d,Log.v和Log.i调用。

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(...);
}

最终的结果是,这些日志线不是在释放的apk,并因此与的logcat任何用户将看不到D / V / 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.

这篇关于在发布Android应用程序完全禁用LogCat中输出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆