---
title: "How to debug an application in Android Studio?"  
description: "How to debug an application in Android Studio?"  
author: "Tarun Gautam"  
published: 2018-01-12  
canonical: https://answers.mindstick.com/qa/32936/how-to-debug-an-application-in-android-studio  
category: "technology"  
tags: ["android", "android studio", "debug"]  
reading_time: 2 minutes  

---

# How to debug an application in Android Studio?

How to [debug](https://www.mindstick.com/interview/20/how-do-you-debug-an-asp-dot-net-web-application) an [application](https://www.mindstick.com/blog/59/xaml-extensible-application-markup-language) in [Android Studio](https://www.mindstick.com/blog/10942/android-studio-vs-eclipse)?

## Answers

### Answer by Prateek sharma

Debugging can be done by either creating **log statements** which will execute at the **runtime** or set the breakpoints.**Debugging by setting breakpoints.** In order to start with this debugging, you need to enable the debugging. To do this follow the steps –1. Install **LLDB** from the **SDK Manager**.2. Enable debugging on your device.3. Run a debuggable build variant: You need to simply do this in your build.gradle file

```
android {
    buildTypes {
        customDebugType {
            debuggable true
        }
    }
}
```

To start debugging follow the steps –1. Set some **breakpoints** in your code.2. Click the debug button from your [android](https://www.mindstick.com/articles/1672/android-internals) studio toolbar3. This will open a window with the connected devices, simply select any one and click Ok.![How to debug an application in Android Studio?](https://answers.mindstick.com/questionanswer/3e66223f-e186-4304-aada-743c2ce530ea/images/d222f8ae-17ae-4474-8d27-fd79d0444a56.jpeg)\
4. This action will open a debug window showing current thread and object tree for the variable.5. If you want to move to the next line while debugging you need to click on f7.**Debugging by log statements.** To generate the log you need to look at the log monitor which is situated at the bottom of the android studio.![How to debug an application in Android Studio?](https://answers.mindstick.com/images/17jan2018/2d74decc-9940-4e8d-af10-355ad588a853.png)\
This will show all the log details to you.you can insert the various log comments from your code, for example, to insert verbose you need to write-Log.v("TAG", "MESSAGE");there are various types of Logging statements you can write for various purposes -1. Log.e(String, String) (error)2. Log.w(String, String) (warning)3. Log.i(String, String) (information)4. Log.d(String, String) (debug)5. Log.v(String, String) (verbose)


---

Original Source: https://answers.mindstick.com/qa/32936/how-to-debug-an-application-in-android-studio

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
