31

How can open debug mode when application is running on android studio.,

My application is appearing on -Android Device Monitor- Devices tab . When i clicked application line on this screen ,debug icon is not active

How can i pass to debug mode after running my application?

tshepang
  • 12,111
  • 21
  • 91
  • 136
skhizein
  • 437
  • 1
  • 9
  • 15

2 Answers2

66

In Android Studio (I'm currently using I/O Preview 0.2.10) simply click on the icon in the toolbar that looks like a phone with a bug over it - the hover text says: Attach debugger to Android process. It's the third icon along: Attach debugger

A list will then appear showing your processes that you can debug. Choose one and select OK - your application is now being debugged!

Note: Make sure your app is debuggable, as shown here.

Community
  • 1
  • 1
ingh.am
  • 25,981
  • 43
  • 130
  • 177
  • wait... i have been debugging for a long time without ever having set the "debuggable" flag. Does this only affect the ability to do certain debugging functions? I'm able to attach but my breakpoint isn't being hit even though I'm seeing that it should be. – Michael Sep 27 '17 at 00:25
0
Main Menu Toolbar -> Attach Debugger to Android Process
//or
Run -> Attach Debugger to Android Process

Icon looks like

One more interesting feature is Attach Debugger when app is starting(using Run or open/reopen on device)

Developer options -> Select debug app 
Developer options -> Wait for debugger
yoAlex5
  • 29,217
  • 8
  • 193
  • 205