How can HierarchyViewer tool of android studio know the properties of views of android screen -
i want know how hierarchyviewer tool works in android. android app runs in different processes, how can know layout of views. pushes views , properties hierarchyviewer.
which service of android push data hierarchyviewer tool. can please explain me please?
lets first @ how adb organized. has 3 main components described here -
- client - clients running on machine being used development. client invoked shell issuing adb command. hierarchy viewer creates adb client.
- server - server runs background process on development machine.it communicates commands issued adb client adbd(adb daemon).
- adbd - adb daemon runs background process on each emulator or device. adb daemon responsible communication of data emulator or device adb server. adb daemon communicates various services running on device via binder ipc mechanism.
for example when issue command adb install example.apk
on shell. first invokes adb client on machine , tells wants install example.apk. server sends apk along command the adb daemon running on device. communication done done adb bridge communicating via tcp connection running @ port 5554. adb daemon calls system server carry out command.
now lets have @ android device side of story -
on every android device there server called system server. can find status of issuing command adb shell ps | grep system_server
. system server responsible management of services. services run system server
- device policy
- audio service
- power manager
- package manager
- content providers
- window manager
- activity manager , many more....
the window manager has information - main thread, window manipulation, orientation, layering, input event management, focus etc. information on views available windows manager.
so putting final flow hierarchy viewer -
- hierarchy viewer creates adb client asking information on viewswhen issued command
remote_command_capture_layers
orcommand_window_manager_list
. - the request reaches adb server forwards adbd on device running application.
- adbd forwards request system server identifies service request has forwarded. in case window manger.
- window manger asks view manager responsible managing of thread pool main ui thread of application.
- view manager returns information window manager.
- window manager sends data adbd.
- adbd communicates adb server.
adb server gives data hierarchy viewer.
hope helps.
Comments
Post a Comment