免费文档

android adb

交谈中请勿轻信汇款、中奖信息、陌生电话,勿使用外挂软件。

睡觉啃熊掌 10:21:21 AM

/* here's how these things work.

when adbd starts, it creates a unix server socket

named @vm-debug-control (@ is a shortcut for "first byte is zero"

to use the private namespace instead of the file system)

when a new JDWP daemon thread starts in a new VM process, it creates

a connection to @vm-debug-control to announce its availability.

JDWP thread @vm-debug-control

| |

|-------------------------------> |

| hello I'm in process <pid> |

| |

| |

the connection is kept alive. it will be closed automatically if

the JDWP process terminates (this allows adbd to detect dead

processes).

adbd thus maintains a list of "active" JDWP processes. it can send

its content to clients through the "device:debug-ports" service,

or even updates through the "device:track-debug-ports" service.

when a debugger wants to connect, it simply runs the command

equivalent to "adb forward tcp:<hostport> jdwp:<pid>"

"jdwp:<pid>" is a new forward destination format used to target

a given JDWP process on the device. when sutch a request arrives,

adbd does the following:

- first, it calls socketpair() to create a pair of equivalent

sockets.

- it attaches the first socket in the pair to a local socket

which is itself attached to the transport's remote socket:

- it sends the file descriptor of the second socket directly

to the JDWP process with the help of sendmsg()

相关文档
热门文档
你可能喜欢
  • android+okhttp工具类
  • android压力测试工具
  • android性能测试工具
  • windows rt越狱工具
  • android工具使用
评论