Guide · Debugging

Debugging in LingCode

Breakpoints, step, threads, stack, variables, expression evaluation. iOS, macOS, and Android — all from inside the editor, no Xcode or Android Studio required.

Two debuggers, one UI. LingCode wraps lldb-dap for Apple targets and the JDWP-based Kotlin debugger for Android, then exposes both through the same panel. The buttons (Continue / Step Over / Step Into / Step Out / Pause) work the same way regardless of target.

Prerequisites

Set a breakpoint

Click the gutter

Open any source file (.swift, .m, .kt, .java). Click the line number in the left gutter — a red dot appears. Click again to remove. Same gesture as Xcode and IntelliJ.

Add a condition (optional)

Open the Breakpoint Navigator from the sidebar (the breakpoint icon). Each breakpoint has an editable condition field — type a Swift / Kotlin expression and the debugger only stops when it evaluates to true. Useful for "stop the 100th time" or "stop only when user.id == 42".

Launch under the debugger (Apple)

Pick a destination

Top-right of the editor: the destination dropdown lists every booted simulator and physical device. Pick one. If nothing shows up, open Xcode → Window → Devices and Simulators once to register them.

Hit Debug (⌘⇧Y)

LingCode does what Xcode would do: xcodebuild in Debug config → installs the .app on the destination → launches under lldb-dap → attaches the UI. Build output streams to the Output panel; runtime print() and crashes stream to the Run Console panel; debugger transcript appears in the DAP Debug panel.

Hit a breakpoint

When execution stops, the FloatingDebugToolbar appears over the editor with Continue / Step Over / Step Into / Step Out / Pause buttons. The line is highlighted in the editor; the call stack appears in the DAP panel.

Launch under the debugger (Android)

Boot an emulator or plug in a device

Use the destination dropdown. The Android toolchain banner verifies adb, the SDK, and JDK before letting you launch.

Hit Debug

LingCode builds via Gradle (./gradlew installDebug equivalent), launches the app on the device, and attaches the JDWP debugger. The Kotlin Debug panel shows threads, stack, and variables.

Inspect state while paused

Step / continue / pause

Use the FloatingDebugToolbar that appears over the editor, or the Debug panel buttons. Standard semantics:

Debug Console (the bottom-panel tab)

Separate from the LLDB debugger, the Debug Console tab in the bottom panel is a live NDJSON log viewer. Anything written to ~/Library/Logs/LingCode/diagnostics-*.json or ai-events-*.json streams here in real time, with filter and clear. Use this when:

Skip the debugger: just ask the AI to fix it

This is what makes LingCode different from Xcode and Android Studio. The agent already has read access to your build state — you don't have to copy-paste anything. Open the chat panel and try one of these:

The agent has the same tools you do — read_file, search_replace, run_build, run_tests, goto_line, plus the build/run-console readers. Tell it the symptom; it finds the cause and proposes the fix. You stay in the editor the whole time.

Best results when you give it scope. "Fix the bug" is vague — the agent might fix the wrong one. "Look at the type-mismatch error in UserView.swift from the last build and fix it" is targeted; the agent goes straight to the issue.

Debug Mode (no debugger required)

The Debug sidebar tab opens a debugging-assistance workspace independent of LLDB. It pairs:

Useful when you're debugging a flaky integration, a third-party SDK with bad logging, or anything where you want to think about a bug before stepping through code.

Troubleshooting

What to read next

Not downloaded yet?

Download for Mac