Debug Your Android App
Remote Debugging allows you to debug your application on a remotely located device. This section describes a practical example of how to debug your application.
Debug Your Application
Let's say your banking application has an issue with retrieving the correct account balance value when the user logs out of the application and then back in.
Head over to Android Studio and set the breakpoints in the code where the balance is evaluated and retrieved.
Here, two breakpoints were set, one for the condition that wraps the code that evaluates the balance and the other for the actual code that evaluates and retrieves the balance.
Run in Debug Mode
In Android Studio, click Run → Debug App.
As you interact with the app, the program hangs wherever you set the breakpoints, in this case the login and balance retrieval actions.
In the debugger console, you see the status of the conditional boolean and the value of balance at the moment of its retrieval. You can check why the balance was incorrectly evaluated.
Make the necessary changes in your code and run the Debugger again to verify that the changes you have applied fixed the issue you attempting to debug.