问题描述
我正在运行一个面向 2.3(API 级别 9)的模拟器.我已经删除了所有下载的应用程序(包括我编写的任何代码),但是当我启动模拟器时,我仍然收到所有这些 logcat 错误:
I'm running an emulator targeting 2.3 (API Level 9). I've removed all downloaded apps (which includes any code that I've written) but I still get all of these logcat errors when I start up the emulator:
[ollie@devdataload scripts]$ startlogcat.sh
- waiting for device -
E/Zygote ( 32): setreuid() failed. errno: 2
E/Zygote ( 32): setreuid() failed. errno: 17
E/BatteryService( 61): usbOnlinePath not found
E/BatteryService( 61): batteryVoltagePath not found
E/BatteryService( 61): batteryTemperaturePath not found
E/SurfaceFlinger( 61): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake
E/SensorService( 61): couldn't open device for module sensors (Invalid argument)
E/System ( 61): Failure starting core service
E/System ( 61): java.lang.SecurityException
E/System ( 61): at android.os.BinderProxy.transact(Native Method)
E/System ( 61): at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)
E/System ( 61): at android.os.ServiceManager.addService(ServiceManager.java:72)
E/System ( 61): at com.android.server.ServerThread.run(SystemServer.java:206)
E/EventHub( 61): could not get driver version for /dev/input/mouse0, Not a typewriter
E/EventHub( 61): could not get driver version for /dev/input/mice, Not a typewriter
E/SoundPool( 61): error loading /system/media/audio/ui/Effect_Tick.ogg
E/SoundPool( 61): error loading /system/media/audio/ui/KeypressStandard.ogg
E/SoundPool( 61): error loading /system/media/audio/ui/KeypressSpacebar.ogg
E/SoundPool( 61): error loading /system/media/audio/ui/KeypressDelete.ogg
E/SoundPool( 61): error loading /system/media/audio/ui/KeypressReturn.ogg
E/UsbObserver( 61):
E/UsbObserver( 61): java.lang.NullPointerException
E/UsbObserver( 61): at com.android.server.UsbObserver.init(UsbObserver.java:131)
E/UsbObserver( 61): at com.android.server.UsbObserver.<init>(UsbObserver.java:65)
E/UsbObserver( 61): at com.android.server.ServerThread.run(SystemServer.java:402)
E/ThrottleService( 61): Could not open GPS configuration file /etc/gps.conf
E/logwrapper( 125): executing /system/bin/tc failed: No such file or directory
E/logwrapper( 126): executing /system/bin/tc failed: No such file or directory
E/logwrapper( 127): executing /system/bin/tc failed: No such file or directory
我想尝试清理这些错误,以便确定我正在查看的任何错误都是由我的代码引起的.是否有其他人收到这些错误消息,您是修复它们还是忽略它们?
I'd like to try to clean these up so that I can know for sure that any errors I'm looking at are being caused by my code. Does anyone else get these error messages and do you fix them or just ignore them?
推荐答案
Android 中常见的日志记录做法是这样的:
Common logging practice in Android is smth like:
public class MyClass
{
public static final String TAG=MyClass.class.getName();
// some stuff
Log.i(TAG, "My log message");
}
因此,当您检查 LogCat 消息时,您可以使用这些 TAG
过滤日志.这是忽略其他日志的方式.
So when you're inspecting LogCat messages you can filter your logs using those TAG
. This is way to ignore other logs.
这篇关于运行android模拟器时出现Logcat错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!