> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xenoci.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Debug

> box debug runs the app under LLDB, stops at your breakpoints and prints the stack and variables

> [!NOTE]
>
> **When to use it.** A value is wrong and the log does not say why. XenoCI Box launches the app under LLDB on the Mac, stops at the line you name and prints the stack and the variables, so your agent reads the state instead of guessing. It is iOS only

## Run it

```bash theme={"system"}
box debug --break HomeView.swift:21
```

<video controls muted loop playsInline autoPlay preload="metadata" poster="/media/docs/ios-debug-poster.webp" src="https://mintcdn.com/xenoci/ZFKGlbE4Q2bw14Om/media/docs/ios-debug.mp4?fit=max&auto=format&n=ZFKGlbE4Q2bw14Om&q=85&s=b8f96f931d8cec7ccdb5c02d6fdb93bf" width="1280" height="778" />

box debug stopping at a breakpoint in TallyApp.swift and printing a variable

Name the file without its folder. This is what box printed for [SwiftieDev/SwiftUI-ToDos-App](https://github.com/SwiftieDev/SwiftUI-ToDos-App) (MIT), stopping in the home screen's body when the app first draws it

```text theme={"system"}
box: queue: job bj_n8XhFGBQTBE0479Z (debug, ios, $0.05/min) submitted
box: build: done in 18s
debug: attached to com.swiftiedev.ToDos pid 4722
breakpoint 1: HomeView.swift:21 (pending until the code loads)

== stop 1: thread 1, breakpoint 1.1
stack:
  #0 closure #1 in closure #1 in HomeView.body.getter at HomeView.swift:21
  #1 partial apply for closure #1 in VStack.init(alignment:spacing:content:) at SwiftUICore
  #2 _VariadicView.Tree.init(_:content:) at SwiftUICore
  #3 VStack.init(alignment:spacing:content:) at SwiftUICore
  #4 closure #1 in HomeView.body.getter at HomeView.swift:20
  #5 NavigationStack.init<>(path:root:) at SwiftUI
  #6 HomeView.body.getter at HomeView.swift:19
…
box: status: succeeded
box: results: saved to ./.box/out/bj_n8XhFGBQTBE0479Z/ (build.log, debug.txt, list.json)
box: bj_n8XhFGBQTBE0479Z succeeded, 120s billed, $0.10
```

The stack runs 15 frames deep in the saved `debug.txt`; it is cut here after frame 6

## Options

* `--print VAR` shows a variable at each stop, for example `--print self.items.count` (default: all locals). Inside a SwiftUI body, properties of the view need `self.`
* `--break` up to 10 times, as `File.swift:42` or a function name; `--stops` records more than one stop
* `--tap-label "Save"` or `--tap-id` taps a control after launch to reach code behind it; `--wait` is how long to wait for a stop (default 60 s)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.