3

Why if I want to debug application always appears message "monitor will be closed to enable ADB integration"?

enter image description here

olegflo
  • 1,105
  • 3
  • 17
  • 26

2 Answers2

0

Quite late but I leave the answer just as future reference. I faced the same issue in android studio which is based on idea when I open DDMS. I think this answer (https://stackoverflow.com/a/9258707/677096) replies to your question.

I just would add that the message tells you that Idea will stop using the integration it has internally for debug android, so it will allow you using DDMS to debug code. DDMS is an external tool, so in order to debug with it you need to configure your IDE as explained here: http://developer.android.com/tools/debugging/debugging-projects-cmdline.html#start-debugging.

I have not done it but I assume you need to do remote debugging as explained here:

http://www.jetbrains.com/idea/webhelp/run-debug-configuration-remote.html

Community
  • 1
  • 1
silver_mx
  • 828
  • 9
  • 16
0

I was using Android studio and my guess: Monitor(DDMS) and and INTELIJ are conflicting since both of them are using adb(android debug bridge). And that is because single debugger can be attached to single VM(app).

DDMS assigns a debugging port to each VM on the device. Typically, DDMS assigns port 8600 for the first debuggable VM, the next on 8601, and so on. When a debugger connects to one of these ports, all traffic is forwarded to the debugger from the associated VM. You can only attach a single debugger to a single port...

Despite that you should be able to use multiple debuggers on single VM(app) using port forwarding provided by DDMS:

You can only attach a single debugger to a single port, but DDMS can handle multiple, attached debuggers.

By default, DDMS also listens on another debugging port, the DDMS "base port" (8700, by default). The base port is a port forwarder, which can accept VM traffic from any debugging port and forward it to the debugger on port 8700. This allows you to attach one debugger to port 8700, and debug all the VMs on a device. The traffic that is forwarded is determined by the currently selected process in the DDMS Devices view.

You can make sure that this is possible by connecting to DDMS via simple debugger i.e jdb (java debugger) via:

jdb -attach localhost:8700

(if DDMS forwarding on 8700 port)

This is as much as I know.

I can't post more than 2 links, but quotes are from official android developers site with title:

Using DDMS

Some links:

adb overview

Useful blog record

Žilvinas Rudžionis
  • 1,954
  • 20
  • 28