Reputation: 4595
I have the source code of a complex application, comprised of several Activities, Classes and method, each one calling each other.
I need to understand how the app works and because it is very complex I would like to see how it executes step by step. If I user the debugger it works, but as soon as a Class calls a Method on another class, the flow breaks. Basically I would need to understand how to debug line by line an application made of many Classes. What I have tried so far did not work, as I said before.
Upvotes: 0
Views: 2513
Reputation: 12919
The Step Into command is what you are looking for.
When the execution is before a call to a method of another class (The line that calls the other class is marked), press the Step Into
button from the debug tool bar. This will jump right into the other class and show you how the method there is executed step by step.
This is what the Step Into button looks like:
If you also have not found a way to execute the program line by line yet, the Step Over
command is what you need for that. Look for this button:
Upvotes: 3
Reputation: 2737
Two primary ways to step through your code while debugging is using Step Over
and Step Into
.
Step Over
(default F6 in Eclipse, F8 in Android Studio), which sounds like what you are using, will run your code, line by line, but will "step over" any methods that the current file is calling. This can be helpful for when you are debugging how various components interact, or for when you want to step over system or library methods that are well tested.
Step Into
(default F5 in Eclipse, F7 in Android Studio), which sounds like what you are looking for, will run your code, line by line, and will "step into" any methods that the current file is calling, letting you dive deeper into your application. This can be helpful for when you are tracking an error where you arent exactly sure what the cause is, but can determine a good spot to pause the application before it hapens.
Upvotes: 1