public static JSONObject dumpHierarchy(View view) throws JSONException {
    return dumpHierarchy(AccessibilityUtil.generateAccessibilityTree(view, null));
  }
Dumps information about the accessibility hierarchy into a JSON object
core/src/main/java/com/facebook/testing/screenshot/layouthierarchy/AccessibilityHierarchyDumper.java