Mobile Inspector
Ghost’s mobile inspector is the killer feature — it unifies traffic inspection, UI element analysis, and traffic-UI correlation in a single tool. No competitor offers this combination.
Three-Column Layout
Section titled “Three-Column Layout”┌──────────────────┬──────────────────┬──────────────────┐│ │ │ ││ Device Screen │ Element Tree │ Element Detail ││ (live mirror) │ (hierarchy) │ ││ │ │ Attributes ││ Tap to select │ Searchable │ Selectors ││ Hover highlight │ Collapsible │ Correlated ││ Freeze/Scrub │ Color-coded │ Traffic ││ │ Compressed │ ││ │ │ │└──────────────────┴──────────────────┴──────────────────┘Supported Platforms
Section titled “Supported Platforms”| Platform | Screenshot | Element Tree | Selectors | Touch Monitor | Interaction Capture |
|---|---|---|---|---|---|
| Android (ADB) | screencap | uiautomator dump | 5 strategies | getevent parser | Real-time |
| Android Emulator | Same as physical | Same | Same | Same | Same |
| iOS Simulator | simctl io screenshot | WDA /source | 4 strategies | Hierarchy diffing | On-demand |
| iOS Physical | Deferred | Deferred | Deferred | Deferred | Deferred |
Device Discovery
Section titled “Device Discovery”Ghost automatically discovers connected devices:
- Android:
adb track-deviceslistener — real-time USB/WiFi device detection - iOS:
xcrun simctl list devices --jsonpolling — booted simulator detection - WDA: Automatic build + launch for iOS simulators when connecting
Devices appear in the Device Navigator in the scope panel sidebar. Click a device to open the inspector.
Screen Mirroring
Section titled “Screen Mirroring”The device screen is mirrored via screenshot polling:
- 1 FPS refresh rate (screenshots every ~1 second)
- Ring buffer of 30 frames for scrubbing back in time
- Tap on the screenshot to select the element at those coordinates
- Hover to see element highlight overlay
- Freeze to stop refreshing (for analysis)
- Scrub slider to navigate screenshot history
Coordinate Mapping
Section titled “Coordinate Mapping”Touch coordinates are mapped from the screenshot display to device coordinates using separate X/Y scaling ratios (critical for non-square aspect ratios). iOS WDA uses its own coordinate system that requires platform-specific translation.
Element Tree
Section titled “Element Tree”The element tree shows the native view hierarchy parsed from platform-specific sources:
- Android:
uiautomator dumpXML → unified element model - iOS: WDA
/sourceaccessibility tree XML → unified element model
Tree Features
Section titled “Tree Features”- Search — find elements by text, class, or attribute
- Expand/Collapse — navigate the hierarchy
- Compression — zero “container noise” (empty layout wrappers removed,
+Nbadges show compressed children) - Color coding — element types color-coded (text, buttons, images, inputs)
- Auto-refresh — 3-second polling with fingerprint-based skip (only re-renders when hierarchy changes)
Unified Element Model
Section titled “Unified Element Model”Both platforms map to a common Element struct (Go type, serialized as JSON to the frontend):
type Element struct { ID string // Unique within the tree ClassName string // "UIButton" (iOS), "android.widget.TextView" (Android) Text string // Visible text content ResourceID string // Android resource-id (e.g., "com.app:id/btnCart") AccessibilityID string // Accessibility identifier ContentDesc string // Android content-desc Label string // iOS accessibility label Name string // iOS accessibility name Value string // Current value (text fields) Bounds Bounds // Screen coordinates {X, Y, Width, Height} Attributes map[string]string // Extra platform-specific attributes Children []*Element // Child elements in the hierarchy Depth int // Nesting depth from root Platform string // "android" or "ios" Visible bool Clickable bool Enabled bool Focused bool Scrollable bool Selected bool Checked bool Traits string // iOS only: "Button, Selected" PackageName string // Android only ElementCount int // Total descendant count (root only)}Selector Generation
Section titled “Selector Generation”When you select an element, Ghost generates all applicable selectors with reliability scoring:
Android Selectors (5 strategies)
Section titled “Android Selectors (5 strategies)”| Strategy | Example | Reliability |
|---|---|---|
accessibility_id | "Add to Cart" (from content-desc attribute) | Excellent |
resource_id | "com.example:id/btnCart" | Good |
content_desc | "Add to Cart" (only when different from accessibility_id) | OK |
ui_selector | new UiSelector().className("Button").text("Add to Cart") | OK |
xpath | //android.widget.Button[@text="Add to Cart"] | Fragile |
iOS Selectors (4 strategies)
Section titled “iOS Selectors (4 strategies)”| Strategy | Example | Reliability |
|---|---|---|
accessibility_id | "addToCart" (from name attribute) | Excellent |
predicate_string | type == "XCUIElementTypeButton" AND label == "Add to Cart" | Good |
class_chain | **/XCUIElementTypeButton[\label == “Add to Cart”`]` | OK |
xpath | //XCUIElementTypeButton[@label="Add to Cart"] | Fragile |
Multi-Framework Formats
Section titled “Multi-Framework Formats”Each selector can be copied in multiple automation framework formats:
| Format | Example |
|---|---|
| Raw | Direct selector value |
| Appium Java | driver.findElement(MobileBy.accessibilityId("Add to Cart")) |
| Appium Python | driver.find_element(AppiumBy.ACCESSIBILITY_ID, "Add to Cart") |
| Maestro | - tapOn: "Add to Cart" |
| Espresso | onView(withContentDescription("Add to Cart")) |
| XCUITest | app.buttons["addToCart"].tap() |
Traffic-UI Correlation
Section titled “Traffic-UI Correlation”The inspector’s most powerful feature: tap a button → see the API call it triggered.
Correlation uses:
- Time window: ±3 seconds between interaction and flow
- Relevance ranking: Closer in time = higher relevance
- Static asset filtering: CDN/image/font requests excluded
- Deduplication: Multiple touches on same element don’t multiply
Interaction Capture
Section titled “Interaction Capture”Android (Real-Time)
Section titled “Android (Real-Time)”Ghost monitors /dev/input/ events via adb getevent:
- Tap detection (touch down + up within threshold)
- Scroll detection (multi-touch movement)
- Long press detection (sustained contact)
- Raw coordinate → pixel conversion using input device calibration
- Hierarchy hit-testing to identify the tapped element
iOS (On-Demand)
Section titled “iOS (On-Demand)”Ghost polls the hierarchy every 2.5 seconds and diffs snapshots:
- Value changes — text field content changed
- Text changes — labels updated
- Screen changes — new screen appeared
- State changes — element enabled/disabled/visibility
Bug Reports
Section titled “Bug Reports”From the inspector, press Cmd+B to generate a premium bug report:
- Instant loading — overlay opens immediately with skeleton
- AI-enhanced — LLM analyzes device context, interactions, and traffic
- Screenshot GIF — animated replay from the ring buffer (30 frames, 0.25x scale)
- Repro steps — auto-generated from interaction timeline
- Network waterfall — timing chart of related API calls
- Mermaid diagram — sequence diagram of the user flow
- Editable — modify title, description, repro steps before export
- Export — Markdown, HTML (standalone with embedded images), Jira, JSON
See Bug Reports for full details.
Inspector Toolbar
Section titled “Inspector Toolbar”| Action | Description |
|---|---|
| Select mode | Click screenshot to select element |
| Tap mode | Click screenshot to send tap to device |
| Freeze/Resume | Pause screenshot updates |
| Refresh | Force hierarchy refresh |
| Screenshot | Save current frame |
| Bug Report | Generate premium bug report (Cmd+B) |
| Text Input | Type text into the focused field on device |