explaingit

everettjf/treescope

17HTMLAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

A debug tool for iOS, macOS, and tvOS developers that lets you inspect your running app's full view hierarchy in any browser, including SwiftUI views with live state, by adding one line of code to your debug build.

Mindmap

mindmap
  root((treescope))
    What it does
      Inspects view hierarchy
      Live property editing
      3D exploded diagram
    Supported platforms
      iOS and iPadOS
      macOS and tvOS
    Features
      SwiftUI support
      Browser-based viewer
      CLI and MCP server
    Audience
      iOS developers
      Apple app teams
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Inspect the live view hierarchy of a running iOS or macOS app in a browser to debug layout and sizing issues without installing extra tools.

USE CASE 2

View SwiftUI view state, modifiers, and struct values alongside UIKit layer geometry in one interactive interface.

USE CASE 3

Automate UI inspection queries from an AI coding assistant using the built-in MCP server mode.

Tech stack

SwiftHTML

Getting it running

Difficulty · easy Time to first run · 5min

Only included in debug builds, not added to production app bundles.

MIT licensed, use and modify freely in any project including commercial, just keep the copyright notice.

In plain English

Treescope is a debugging tool for Apple platform developers that lets you inspect the live visual structure of a running iOS, macOS, or tvOS app directly in a web browser. When you are building an app and want to understand exactly how the interface is laid out, which views are nested inside which, and what properties each one has, Treescope gives you a browsable interactive view of all of that information without needing to install any extra app on your machine. The way it works is that you add a small library to your app's debug build with one line of code. When the app runs, that library starts a tiny local web server. You then open a browser and go to a localhost address, and you see the full visual hierarchy of your running app. You can browse the tree of views, see their sizes and positions, take snapshots of individual elements, and view everything in an exploded 3D diagram that shows how the layers stack on top of each other. Some properties can be edited live without restarting the app. One of its distinguishing features is support for SwiftUI, which is Apple's newer way of building interfaces. Most similar tools only work with the older UIKit and AppKit systems. Treescope inspects SwiftUI using public reflection techniques rather than private or restricted system APIs, so it shows you the declared view structure, state values, and modifiers for your SwiftUI views alongside the traditional layer geometry. Because the viewer runs in a browser, there is nothing extra to install. Anyone on macOS, Windows, or Linux can open the URL. There is also a command-line interface for scripting and automation, and an MCP server mode for AI coding assistants that want to query the view hierarchy programmatically. The library adds no production dependencies to your app since it is only included in debug builds. It uses only Apple's built-in networking framework and does not require any third-party packages. The project is MIT licensed.

Copy-paste prompts

Prompt 1
I am building an iOS app with SwiftUI and need to debug a layout issue. Walk me through adding Treescope to my debug build and using the browser viewer to find which view is causing the wrong sizing.
Prompt 2
How do I use Treescope's 3D exploded view to understand how my SwiftUI layers are stacking in a complex screen with overlapping views?
Prompt 3
I want to connect Treescope's MCP server to Claude so my AI assistant can query my running app's view hierarchy. How do I set that up and what kinds of questions can I ask?
Prompt 4
Show me how to use Treescope's CLI to snapshot a specific view in my running macOS app and extract its exact frame and properties.
Open on GitHub → Explain another repo

← everettjf on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.