Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/LeoNatan/LNViewHierarchyDumper
Dump your view hierarchies programmatically to Xcode 12 and above compatible view hierarchy file archives.
https://github.com/LeoNatan/LNViewHierarchyDumper
ios macos swift xcode
Last synced: 3 months ago
JSON representation
Dump your view hierarchies programmatically to Xcode 12 and above compatible view hierarchy file archives.
- Host: GitHub
- URL: https://github.com/LeoNatan/LNViewHierarchyDumper
- Owner: LeoNatan
- License: mit
- Created: 2020-07-03T17:01:34.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-08-23T00:12:20.000Z (about 1 year ago)
- Last Synced: 2024-07-23T14:44:29.745Z (4 months ago)
- Topics: ios, macos, swift, xcode
- Language: Objective-C
- Homepage:
- Size: 805 KB
- Stars: 22
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# LNViewHierarchyDumper
A framework for programmatically dumping the view hierarchy of your app into an Xcode 12 and above compatible view hierarchy file archive.
[![GitHub release](https://img.shields.io/github/release/LeoNatan/LNViewHierarchyDumper.svg)](https://github.com/LeoNatan/LNViewHierarchyDumper/releases) [![GitHub stars](https://img.shields.io/github/stars/LeoNatan/LNViewHierarchyDumper.svg)](https://github.com/LeoNatan/LNViewHierarchyDumper/stargazers) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/LeoNatan/LNViewHierarchyDumper/master/LICENSE)
[![GitHub issues](https://img.shields.io/github/issues-raw/LeoNatan/LNViewHierarchyDumper.svg)](https://github.com/LeoNatan/LNViewHierarchyDumper/issues) [![GitHub contributors](https://img.shields.io/github/contributors/LeoNatan/LNViewHierarchyDumper.svg)](https://github.com/LeoNatan/LNViewHierarchyDumper/graphs/contributors) ![](https://img.shields.io/badge/swift%20package%20manager-compatible-green)
The framework supports dumping the view hierarchy of apps running on iOS, tvOS and watchOS simulators, hardware devices **with developer image mounted**, and macOS and Catalyst **with Xcode installed**. Under unsupported targets or environments, the frameworks fails silently and returns an error.
**This framework uses Xcode's internal DebugHierarchyFoundation framework, and is not AppStore safe**, thus you should use with care, only linking against it in development/testing scenarios/builds. Since the framework requires developer tooling (developer image mounted on iOS hardware; Xcode on macOS), there would be little benefit from having this framework in production anyway.
Deploying the framework conditionally is a complex topic, beyond the scope of this README. One strategy can be to link the dynamic library with UI testing project, and launch your app with the `DYLD_INSERT_LIBRARIES` environment variable, pointing to the LNViewHierarchyDumper framework.
Using the framework is very easy:
```swift
import LNViewHierarchyDumper//...
let url = //URL to a directory
try LNViewHierarchyDumper.shared.dumpViewHierarchy(to: url)
```