如果未选中 USB 调试,Log.x() 是否会占用任何 CPU?
我知道,为了加快速度并在应用程序发布时消除 CPU 浪费,我可以简单地使用 proguard.cfg
导出它,其中包含:
-assumenosideeffects class android.util.Log {
public static *** v(...);
public static *** i(...);
public static *** d(...);
public static *** w(...);
public static *** e(...);
}
但是...如果,为了方便地最小化杂耍在调试版本和发布版本之间(始终需要在安装另一个版本之前完全卸载一个版本),我希望始终运行调试版本,不通过 USB 连接并使用 Settings =>;应用=>发展=> USB 调试
未选中,Log.v()、Log.i() 等是否会被执行?
我无法真正通过 USB 连接 DDMS 来检查这一点...所以,感谢您的任何提示。
I know that to speed up things and eliminate CPU waste when an application is released, I can simply export it with proguard.cfg
containing:
-assumenosideeffects class android.util.Log {
public static *** v(...);
public static *** i(...);
public static *** d(...);
public static *** w(...);
public static *** e(...);
}
But... if, for the purpose of convenient minimization of the juggle between Debug and Release version (which always requires a full uninstall one one before installing the other), I want to always run the debug version, without being connected via USB and with Settings => Applications => Development => USB debugging
unchecked, do any of the Log.v(), Log.i(), etc. get executed at all?
I can't really connect DDMS via USB to check this myself... so, thanks for any tip.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它仍然会将您的日志消息写入内部日志缓冲区。
市场上有一些应用程序可以显示此缓冲区,其中之一称为 Android System Info 或类似的东西,AFAIR。
It will still write your log message to an internal log buffer.
And there's some apps on the Market that can show this buffer, one of them called Android System Info or something like that, AFAIR.
根据 ProGuard 手册 ( http://proguard.sourceforge.net/index .html#/manual/usage.html ):
因此,对 Log.v()、Log.i() 等的调用甚至不存在于 APK 中。
According to the ProGuard manual ( http://proguard.sourceforge.net/index.html#/manual/usage.html ):
So the calls to Log.v(), Log.i(), etc don't even exist in APK.