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 -

  1. client - clients running on machine being used development. client invoked shell issuing adb command. hierarchy viewer creates adb client.
  2. server - server runs background process on development machine.it communicates commands issued adb client adbd(adb daemon).
  3. 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 -

  1. hierarchy viewer creates adb client asking information on viewswhen issued command remote_command_capture_layers or command_window_manager_list.
  2. the request reaches adb server forwards adbd on device running application.
  3. adbd forwards request system server identifies service request has forwarded. in case window manger.
  4. window manger asks view manager responsible managing of thread pool main ui thread of application.
  5. view manager returns information window manager.
  6. window manager sends data adbd.
  7. adbd communicates adb server.
  8. adb server gives data hierarchy viewer.

    hope helps.


Comments

Popular posts from this blog

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -