0

I am learning android, and developing application without using IDE through ant. I build applications with ant debug, and deploy them on the emulator with adb. I have marked app to wait for debugger to attach from developer settings. However when I try to connect jdb to DDMS port, I get

java.io.IOException: shmemBase_attach failed: The system cannot find the file specified

        at com.sun.tools.jdi.SharedMemoryTransportService.attach0(Native Method)
        at com.sun.tools.jdi.SharedMemoryTransportService.attach(SharedMemoryTransportService.java:90)
        at com.sun.tools.jdi.GenericAttachingConnector.attach(GenericAttachingConnector.java:98)
        at com.sun.tools.jdi.SharedMemoryAttachingConnector.attach(SharedMemoryAttachingConnector.java:45)
        at com.sun.tools.example.debug.tty.VMConnection.attachTarget(VMConnection.java:358)
        at com.sun.tools.example.debug.tty.VMConnection.open(VMConnection.java:168)
        at com.sun.tools.example.debug.tty.Env.init(Env.java:64)
        at com.sun.tools.example.debug.tty.TTY.main(TTY.java:1010)

Fatal error:
Unable to attach to target VM.

I tried

jdb -attach 8700

jdb -connect com.sun.jdi.SocketAttach:port=8700

The app on emulator still shows the dialog, waiting for debugger to connect.

fadden
  • 51,356
  • 5
  • 116
  • 166
user1064504
  • 573
  • 6
  • 16
  • Is DDMS running on your workstation? Have you selected the target app from the list? I think you may want `jdb -attach localhost:8700` (i.e. specify host:port, not just the port number), but it's been a while since I've used it. – fadden Oct 27 '15 at 17:24
  • @fadden yes DDMS running on workstation, tried localhost too and 127.0.0.1 too. No success. – user1064504 Oct 28 '15 at 17:44
  • The way DDMS used to work was that port 8700 connected you to whichever app was selected in DDMS. If no app was selected, port 8700 didn't do anything. I haven't used it in a while, but I assume it works more or less the same way now, so make sure an app is selected. If you're still getting the `shmemBase_attach` error message shown in your question then something is wrong with jdb -- `localhost:8700` should not be using the shared-memory transport. – fadden Oct 28 '15 at 18:05

0 Answers0