LogCat中不显示我的日志调用我的、中不、日志、LogCat

2023-09-12 01:28:41 作者:无可奈何

我在Android的编程共小白,想学习如何调试我的应用程序。我似乎无法让我的Log.i | D |在LogCat中显示v通话。

下面是我使用的code。正如你可以看到我已经定义了一个LOG_TAG不变,但似乎无法找到它的LogCat中。我也进口android.util.Log,我已经确信,在我的Andr​​oidManifest我有可调试设置为TRUE。

我还检查http://developer.android.com/reference/android/util/Log.html W / O任何侥幸解决这一问题。

我是什么做错了吗?难道我连看在正确的地方?我已经使用DDMS和Debug视角,以及W / O任何侥幸尝试。任何帮助这个菜鸟会大大AP preciated。谢谢你。

我的环境: Windows XP中 IDE = Eclipse版本:3.6.1,构建ID:M20100909-0800 仿真器=有它指向的Andr​​oid SDK 2.1 API 7

//非常基本的Hello World code与一对夫妇Log.i来电

 进口android.app.Activity;
进口android.os.Bundle;
进口android.util.Log;

公共类调试器扩展了活动{
    私有静态最后弦乐LOG_TAG =调试;

    / **第一次创建活动时调用。 * /
    @覆盖
    公共无效的onCreate(包savedInstanceState){
        Log.i(LOG_TAG,13号线);
        super.onCreate(savedInstanceState);
        的setContentView(R.layout.main);

        Log.i(LOG_TAG创建NOW);
    }
}
 

解决方案

在使用Eclipse,在DDMS透视图,确保正确的设备(propably仿真器-XXXX)被选中并突出显示。只有这样,你在的logcat视图中的logcat输出。

另外,Android插件是有点quircky,有时只显示了的logcat视图的最后一行。如果发生这种情况,尝试清除日志。在这之后,你应该让所有的日志条目再(为我工作反正)。

Android Logcat不能正常打印日志或显示No debuggable processes Android Studio没有可调试应用 问题解决方案 打印,Log,2021

I'm a total noob at Android programming, and wanted to learn how to debug my apps. I can't seem to have my Log.i|d|v calls displayed in the LogCat.

Here's the code that I'm using. As you can see I have defined a LOG_TAG constant, but can't seem to find it in the LogCat. I have also imported android.util.Log AND I have made sure that in my AndroidManifest I have "debuggable" set to TRUE.

I have also checked http://developer.android.com/reference/android/util/Log.html w/o any luck resolving this issue.

What am I doing wrong? Am I even looking in the right place? I've tried using the DDMS and Debug perspective as well w/o any luck. Any help to this noob would be greatly appreciated. Thanks.

My environment: Windows XP IDE = Eclipse Version: 3.6.1, Build id: M20100909-0800 Emulator = having it point to android sdk 2.1 api 7

//very basic HELLO World code with a couple of Log.i calls

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;

public class debugger extends Activity {
    private static final String LOG_TAG = "debugger";

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        Log.i(LOG_TAG, "line 13");
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        Log.i(LOG_TAG, "CREATING NOW");
    }
}

解决方案

When using Eclipse, in the DDMS perspective, make sure the correct device (propably emulator-xxxx) is selected and highlighted. Only then will you get the logcat output in the logcat view.

Also, the Android plugin is a bit quircky, and sometimes only shows the last line in the logcat view. If this happens, try to clear the log. After that, you should get all the log entries again (works for me anyway).