I just asked this question: Are there ways to get android app view hierarchy from another android app?
I searched the android source a lot, and read the source code hierarchyviewer, seems that hierarchyviewer attached to adb, and then adb use socket connect to adbd runs on the emulator or device.
My device is rooted. Now i’m trying to make my android app connect to local adbd via socket, or call adbd functions via JNI.
Can someone hint me how adbd dump the system’s view hierarchy?
Many thanks.
The HierarchyViewer server does not accept connections from local sockets. The only way to use HierarchyViewer is from the desktop.