0

I'm relatively new to Android Studio and would like to understand how to debug an app . I performed the below steps,

  1. Connected my mobile device to my computer
  2. Enabled Developer mode on my mobile device
  3. The device gets listed in the Android studio
  4. When I click on the debug icon then I see "My application" on my mobile device as "Hello World! " My question is I have an android app in my mobile device and I have been developing something on this app. Now I would like to debug this app something like we have Developer tools in chrome to view the console and debug , is it not possible to view the same thing in android studio? The app that I'm trying to access is compatible to android and has been working fine however after I made a change it not working and I need to debug this issue. I tried the same with an android emulator however still the same issue persists.

android studio

max092012
  • 365
  • 1
  • 5
  • 25

3 Answers3

0

On the Android, the log of device display on Tab Logcat, not on console as the Chrome. You can see the log in this tab, and remember build your App in the debug mode.
Edit: If you want to see all the log, you can switch the option Show only Application selected to No filter

For more information, you can find in this link

Android Studio Debug

seal2002
  • 123
  • 1
  • 11
  • I see logcat is showing some statements only when the 'Hello World' comes up in my phone. What I wish to see log when some app is opened on my phone. Like for example If I try to launch GMAIL from my mobile device then I would like to see its log. – max092012 May 26 '20 at 10:11
  • 1
    The log verbose in logcat tab is output by developer of each app. Usually, the programmer don't want other guys to see their log on release app. So you can't see other app log. If you want to see the system log, you can switch the button `Show only selected application` to no filter. – seal2002 May 26 '20 at 10:26
  • Thanks it worked... I could not mark this as an answer since it was comment – max092012 May 26 '20 at 10:49
  • Hi, I already edit the answer. If you accept it, please make it as answer. – seal2002 May 27 '20 at 00:56
0

You just need to add some breakpoints and run your app in debug mode (shift + F9)

enter image description here

Oussèma Hassine
  • 741
  • 1
  • 7
  • 18
0

Yeah it is possible to debug in android studio.. You can add debug points against each line of code (not for xml layouts).After adding debug points you can either run in debug mode by clicking 'Debug app' or 'Attach debugger to android process'

enter image description here

enter image description here

Abraham Mathew
  • 2,029
  • 3
  • 21
  • 42