barlop
barlop

Reputation: 13780

step without breakpoints in android studio?

I want to get a better idea how a program I have operates, and rather than print the code out and try to see which method calls which method, it'd be easier to just run a debugger that steps through every line.

But manually putting a breakpoint on every line seems a bit laborious.

Is there any option to step through every line of the program as it runs(without manually putting in all the breakpoints)?

So that I could then see, ah MainActivity launches and runs onCreate and I could see it running through the code of onCreate how it then goes to a fragment class's onCreateView method.. and so on.. I want to see who is calling who as it happens and step through.

Upvotes: 1

Views: 831

Answers (1)

Cihan Tek
Cihan Tek

Reputation: 5409

You don't need to add breakpoints on each line. Just add a breakpoint to the entry point of your application and then simply use the step-in and step-out buttons of the debugger to execute the code line by line.

In order to prevent the debugger from stepping through the code that wasn't written by you, go to File > Settings > Debugger > Stepping and then on the right, click the plus icon with the question mark that says Add Pattern to add the following patterns:

android.*
dalvik.* 
com.android.*

Upvotes: 3

Related Questions