(Android Studio) 如何仅通过我的代码进行调试? [英] (Android Studio) How to debug through my code only?

查看:27
本文介绍了(Android Studio) 如何仅通过我的代码进行调试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在 Android 中调试我的代码时(使用 Step Into、F7 命令),调试器会带我浏览所有我不想要的系统类.

When I try to debug through my code in Android (using Step Into, F7 command), the debugger takes me through all system classes, which I do not want.

例如,当我在下面的第 2 行(即startActivity(ourIntent);")放置断点时,执行点不会进入我的 Activity(即myclass)",而是进入 Activity.java > Instrumentation.java等...所有系统类.

For example, when I place a breakpoint at the 2nd line below (i.e. "startActivity(ourIntent);"), instead of going into my Activity (i.e. "myclass), the execution point goes into Activity.java > Instrumentation.java, etc... all system classes.

我不想那样.我只想单步执行我编写的代码.

I dont want that. I only want to step through my code that I have written.

实现这一目标的方法是什么?

What is a way to achieve this?

        Intent ourIntent = new Intent(MainActivity.this, "com.practice.gamesbook.myclass");
        startActivity(ourIntent);

调试器"下的添加新模式"选项>步进"已禁用

"Add new Pattern" option under "Debugger" > "Stepping" is disabled

推荐答案

转到 Android Studio >首选项 >调试器Stepping 然后在底部单击带有问号的加号箭头,上面写着 Add Pattern.输入 android.* 并点击 OK 然后应用.

Go to Android Studio > Preferences > Debugger > Stepping then in the bottom click the plus arrow with the question mark that says Add Pattern. Type android.* and hit OK and then Apply.

这篇关于(Android Studio) 如何仅通过我的代码进行调试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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