Viewglass is a CLI-first iOS runtime inspector compatible with LookinServer and designed for automation, AI workflows, and day-to-day UI debugging.
It is built on top of the open-source Lookin ecosystem, but the project direction here is broader than the original macOS GUI product:
- inspect live iOS view hierarchies from the terminal
- query nodes and attributes in structured output
- capture screen and node screenshots
- export hierarchy data and reports
- diagnose discovery failures with per-port probe output
- support future skills and MCP workflows
- 中文使用说明: Docs/Viewglass-README-CN.md
- 如果你想直接开始,先看下面的
Quick Start,再看中文文档里的详细命令示例
- macOS 12.0+
- Xcode 14+ if you install from source or via Homebrew source build
- an iOS app that integrates ViewglassServer
brew tap WZBbiao/tap
brew install viewglassNotes:
- the current Homebrew formula builds from source
- first install takes a few minutes because it compiles Swift code locally
Download the latest binary from Releases.
# Apple Silicon
curl -fsSL https://github.com/WZBbiao/viewglass/releases/latest/download/viewglass-macos-arm64.tar.gz | tar xz
sudo mv viewglass /usr/local/bin/
# Intel
curl -fsSL https://github.com/WZBbiao/viewglass/releases/latest/download/viewglass-macos-x86_64.tar.gz | tar xz
sudo mv viewglass /usr/local/bin/curl -fsSL https://raw.githubusercontent.com/WZBbiao/viewglass/main/scripts/install.sh | bashgit clone https://github.com/WZBbiao/viewglass.git
cd viewglass
make installViewglass does not instrument apps by itself. The target iOS app must expose Lookin-compatible runtime inspection data through LookinServer.
For app-side integration, use the standalone ViewglassServer repository.
Only the essentials are kept here:
- integrate
ViewglassServerinDebug - keep importing
LookinServerin app code - start with Simulator first if you are validating a new integration
- if the CLI finds no apps, first verify the app actually integrated and started
LookinServer
# 1. Scan for inspectable apps
viewglass scan
viewglass scan --verbose
# 2. List discovered apps
viewglass apps list
viewglass apps list --json
# 3. Connect by bundle id
viewglass session connect com.example.app
# 4. Inspect hierarchy
viewglass hierarchy dump
viewglass hierarchy dump --json
# 5. Query nodes
viewglass query "UIButton AND .visible"
viewglass node get 4
# 6. Capture screenshots
viewglass screenshot screen -o screen.png
viewglass screenshot node 4 -o node.png
# 7. Run diagnostics
viewglass diagnose all
# 8. Export a report
viewglass export report -o report.mdviewglass screenshot now captures high-resolution PNGs through the
ViewglassServer protocol for both simulator and physical devices. It no longer
depends on simctl or idevicescreenshot.
After session connect, the current session is persisted to:
~/.viewglass/session.json
That means most later commands can omit --session.
viewglass scan
viewglass scan --verbose
viewglass apps list --jsonviewglass session connect com.example.app
viewglass session statusviewglass hierarchy dump
viewglass node get 4
viewglass query ".visible AND UILabel"viewglass attr set 4 alpha 0.5
viewglass console eval setNeedsLayout --node-id 4
viewglass refreshviewglass export hierarchy -o hierarchy.json
viewglass export report -o report.md
viewglass diagnose overlap
viewglass diagnose all --jsonapps: discover inspectable appssession: connect, inspect, and disconnect sessionshierarchy: print the full treenode: inspect a single nodequery: filter nodes with an expression languageattr: get or set attributesconsole: invoke methods on objects in the running apprefresh: reload hierarchy from the appscreenshot: capture screenshotsexport: write hierarchy/report output to filesdiagnose: run overlap, hidden-interactive, offscreen, and aggregate checksscan: discovery scan with optional per-port diagnostics
Most commands support:
- human-readable text output by default
--jsonfor scripts, AI agents, and automation
Examples:
viewglass apps list --json
viewglass hierarchy dump --json
viewglass diagnose all --jsonToday, the project provides:
- a working
viewglassCLI - release assets for macOS arm64 and x86_64
- a Homebrew tap
- structured JSON output for automation
- simulator and USB device discovery
- live screen and node screenshots
Planned next layers:
- skills-oriented workflows
- MCP server
- broader runtime inspection depth
- English CLI reference: Docs/Viewglass-README.md
- 中文 CLI 文档: Docs/Viewglass-README-CN.md
- Brand and repo strategy: Docs/Brand-and-Repository-Strategy.md
- Product roadmap: Docs/Roadmap.md
- Contributing: CONTRIBUTING.md
- Code of Conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
- Support: SUPPORT.md