Reputation:
In Visual Studio I can use F5 to cicle through the code step by step without creating more breakpoints.
How can I do this in Android Studio??
Upvotes: 10
Views: 23014
Reputation: 1855
From the Android Developer Fundamentals Course (3.1: The Android Studio Debugger):
Stepping through code
To use any of the step functions:
Begin debugging your app. Pause the execution of your app with a breakpoint.
Your app's execution stops, and the debugger shows the current state of the app. The current line is highlighted in your code.
Click the Step Over icon, select Run > Step Over, or type F8.
Step Over executes the next line of the code in the current class and method, executing all of the method calls on that line and remaining in the same file.
Click the Step Into icon, select Run > Step Into, or type F7.
Step Into jumps into the execution of a method call on the current line (versus just executing that method and remaining on the same line). The Frames view (which you'll learn about in the next section) updates to show the new stack frame (the new method). If the method call is contained in another class, the file for that class is opened and the current line in that file is highlighted. You can continue stepping over lines in this new method call, or step deeper into other methods.
Click the Step Out icon, select Run > Step Out, or type Shift-F8.
Step Out finishes executing the current method and returns to the point where that method was called.
To resume normal execution of the app, select Run > Resume Program or click the Resume icon.
Upvotes: 6
Reputation: 51
Attaching debuggger to process seemed to keep it connected. Run->Attached Debugger to Android Process. F6 to step on mac.
Upvotes: 0
Reputation: 9
mark a break point goto Run -> Debugger when hit on point then press F8 for step by step debugging in android studio
Upvotes: 0
Reputation: 414
From your question it sounds like you are looking for a step by step debugging option? If so, you need only to start your app in debugging mode (Shift + F9) and put in one manual break point by clicking on the far left the line of code you want to stop at. Then use the tools inside the debug window (opens automatically when breakpoint is reached). Step by step is controlled with F8.
Upvotes: 11