This repository contains code examples to use in learning Android Studio's Debugger tool.
If you haven’t already, you should Fork and Clone this repo in order to complete the tutorial.
-
Start Android Studio and select Open an existing Android Studio project.
-
Navigate to the folder for lab-debugger, select that folder file, and click OK.
The Calculator project builds. open the project view if it is not already open.
In this task you'll get an introduction to the debugger in Android Studio, and learn how to run your app in debug mode.
-
Start and Run your app in debug mode: Run > Debug app or click the Debug icon in the toolbar.
-
Open the MainActivity.java file and set a breakpoint by clicking in the left gutter of the editor window at the line. A red dot appears at that line, indicating a breakpoint.
-
In the Calculator app on a device, enter a number and click one of the buttons. The execution of your app stops wen it reaches the breakpoint you set, and the debugger shows the current state of your app at that breakpoint.
-
Resume your app's execution with Run > Resume Program or click the Resume icon on the left side of the debugger window.
The app contains 5 errors that you will need to find and fix using the Debugger.
When you are done finding and fixing the errors, commit your changes and push them back up to your forked repository (the origin
) using the command:
git push origin