有什么不对的调试在Eclipse在Android? [英] What's wrong with debugging in Eclipse on Android?

查看:139
本文介绍了有什么不对的调试在Eclipse在Android?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
  <一href="http://stackoverflow.com/questions/2280079/seemingly-useless-debugging-environment-for-android">Seemingly无用的调试环境为Android

我明显被宠坏了的Visual Studio,因为虽然我刚学Android和Eclipse环境,在Eclipse中调试应用程序正在成为一个严​​重的损害进一步发展。

I've obviously been spoiled by Visual Studio, because although I'm just learning Android and the Eclipse environment, debugging apps in Eclipse is becoming a serious detriment to further development.

例如,Eclipse将编译这个被零除就好了:

For example, Eclipse will compile this divide by zero just fine:

public class Lesson2Main extends Activity
{
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate (savedInstanceState);

        int i = 1 / 0;

        TextView tv = new TextView (this);
        tv.setText ("Hello, Android!");
        setContentView (tv);
    }
}

然后,当它在调试器下执行的话,我会得到无用的调试信息,非全屏其实际指向我包含错误的特定行。

And then, when it executes it under the debugger, I will get a full screen of useless debug info, non of which actually points me to the specific line containing the error.

堆栈跟踪是个例外(E)信息树内空,而它只是陈述一个消息,说明ArithmeticException。 (这很好,你怎么样在你发现它的方向指向我!?)

The stackTrace is null within the exception ('e') info tree, and it simply states a message stating 'ArithmeticException'. (that's nice, how about you point me in the direction of where you found it!?)

我已经找遍了整个屏幕,并感到莫名其妙,这个IDE无法获得这项权利。与Eclipse的度假每个人都没有发展回到1991年的printf()之类记录在每一个时间间隔,然后追查错误?认真。

I've looked all over the screen and am baffled that this IDE can't get this right. Does developing with Eclipse resort everyone back to 1991 with printf() like logging at every interval then to track down bugs? Seriously.

有没有配置或插件,我失踪,以帮助呢?

Is there a configuration or plug-in that I'm missing to help with this?

我还没有测试这种情况下,与X code,但如果iPhone开发。 IDE处理这更像是Visual Studio中,那么难怪在Android市场有这么几个应用程序。

I haven't tested this case with XCode, but if the iPhone dev. IDE handles this more like Visual Studio, then no wonder the Android marketplace has so few apps.

我很兴奋的Andr​​oid,但似乎Eclipse正在获得的方式。

I'm excited about Android, but it seems that Eclipse is getting in the way.

推荐答案

是的,你已经错过了非常重要的插件为Eclipse被称为LogCat中之一。它捕捉所有的调试日志,你的Andr​​oid程序提供,无论是在模拟器或真正的手机上运行。后者显然需要将电话插入到计算机,并不太明显,在应用程序设置 - >开发 - >启用USB调试启用

Yes, you've missed one of the very important plug-ins for Eclipse called "LogCat". It catches all the debugging logs that your Android program gives, whether it's running on the Emulator or a real phone. The latter obviously requires that the phone be plugged in to the computer, and less-obviously, the setting in Application -> Development -> Enable USB Debugging be enabled.

在LogCat中的邮件给你的是什么原因造成的错误,其中包括该行号的细目。要打开LogCat中在Eclipse中,转到窗口 - >显示视图 - >其他 - > Android的(在列表中的一个文件夹) - > LogCat中。然后停靠LogCat中窗口的地方在那里,你可以很容易地看到它,Eclipse会记住位置,并打开它,再下一次你开始吧。

The LogCat messages give you the full breakdown of what caused the error, including the line number. To open LogCat in Eclipse, go to Window -> Show View -> Other -> Android (one of the folders in the list) -> LogCat. Then dock the LogCat window somewhere where you can see it easily, and Eclipse will remember that location and open it up again next time your start it.

(有时LogCat中的模拟器得到彼此分离,以解决这个问题就是关闭Eclipse和仿真器,然后重新启动他们两个最简单的方法。)

(Sometimes LogCat and the Emulator get disconnected from each other. The simple way to fix that is just to close Eclipse and the emulator, then restart them both.)

这篇关于有什么不对的调试在Eclipse在Android?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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