#### « Load the Reveal Server via an Xcode Breakpoint

# Reveal Server Debugger Support

Reveal provides a set of debugger commands accessible from the LLDB console (including Xcode's Debug Console) once installed. These commands allow loading and controlling the Reveal Server library in the current debug session without having to write code or command aliases.

## Installation

To install Reveal Server commands into your debugger, open Reveal's Help menu and click Install Debugger Commands… Confirming the installation will add the following lines into your `~/.lldbinit` file, creating it if necessary:

    ### Reveal LLDB commands support - DO NOT MODIFY
    command script import /Applications/Reveal.app/Contents/SharedSupport/Scripts/RevealServerCommands.py
    ###

This command imports a Python script bundled with Reveal into all your debug sessions. The script implements functionality required to load, start and stop Reveal Server in the Simulator and on device. Note that the command directly references your Reveal installation path: if you move Reveal to a different location, it will offer to update the command.

If you wish, you can copy and paste this command manually into your `~/.lldbinit` file instead, changing `/Applications/Reveal.app` path to the location where you installed Reveal, if necessary. Please note that unless you include the full code snippet with comments, Reveal will not detect your manual installation and will not prompt you if you move it to a different location.

## Removal

To remove the Reveal Server commands from your debugger, open Reveal's Help menu again and click Remove Debugger Commands… This will remove the snippet previously inserted in your `~/.lldbinit` file.

Note that both installation and removal processes move the original `~/.lldbinit` file to Trash, renaming it to `lldbinit.pre-reveal-backup`.

## Available commands

While the easiest way to use Reveal Server debugger commands is to follow the Load the Reveal Server via an Xcode Breakpoint guide, these commands also allow you to control the Server during debugging:

### `reveal load`

Loads the Reveal Server library in the current debug session. If you're debugging in the iOS or tvOS Simulator, this command will use the framework bundled with Reveal directly. When debugging on device, the command will look for `RevealServer.framework` package in your app's resources. If you've followed the instructions in the Debugging on device section of the Load the Reveal Server via an Xcode Breakpoint guide, your app will already contain that resource.

To start Reveal Server automatically after loading it, use the `--autostart` (or `-a`) flag, e.g. `reveal load --autostart`.

### `reveal start`

Starts Reveal Server. Normally this happens automatically if the Server is loaded during application startup (e.g. in `UIApplicationMain` breakpoint), and also every time your app becomes active. However, if you would like to load and control Reveal Server manually, you can use this command to start it easily after you load it using `reveal load` command or by other means.

### `reveal stop`

Stops Reveal Server, if it was previously started. You can restart it later using `reveal start` command.

### `reveal status`

Prints the current status of Reveal Server: whether it's loaded and running, and also its protocol version.

## Getting Help

If you have any problems or questions about using Reveal Server commands with your app, head over to our support site.