> For the complete documentation index, see [llms.txt](https://help.santesuite.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.santesuite.org/developers/applets/applet-sdk/santedb-brain-bug.md).

# SanteDB Brain Bug

The brain bug tool is named after the infamous "Brain Bug" from the movie Starship Troopers. The tool does exactly what that alien did, it extracts logs, files and databases from the dCDR Android Application.&#x20;

The tool was developed to overcome the fact that extracting Android backups is difficult on Microsoft Windows operating systems. To run the brainbug tool you will need the Android SDK installed on your Windows environment.

## Command Line Options

**Tool: `sdb-bb.exe`**

The following command line options are available for the brain bug tool.

| Option   | Description                                                                                                                                                                                                                                                           | Example               |
| -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- |
| help     | Show help for the tool and exit                                                                                                                                                                                                                                       | `--help`              |
| pkgid    | <p>Identifies the package of the android application you wish to extract</p><p>logs and files for. The package identifier is the <code>id</code> of your solution.</p>                                                                                                | `--pkgid=mm.mpi.app`  |
| sdk      | <p>If you've installed the Android SDK in a different location than the</p><p>default for your operating system, this is the path to the <br><code>adb.exe</code> tool.</p>                                                                                           | `--sdk="C:\android"`  |
| bkfile   | <p>If you wish to simply extract your application from the android</p><p>device and save it to ship to another developer, specify the </p><p>backup file. Conversely, if you wish to simply extract the contents</p><p>of a backup file, specify the backup file.</p> | `--bkfile=mybackup`   |
| tar      | <p>If you wish to extract a TAR file from the <code>.ab</code> file then specify<br>the tar archive to be saved. </p>                                                                                                                                                 | `--tar=mybackup.tar`  |
| extract  | <p>If you wish to extract the contents of the backup directly to a</p><p>folder on your computer, this is the path to the extract location.</p>                                                                                                                       | `--extract=C:\issue1` |
| password | Specify the password for an encyrpted backup                                                                                                                                                                                                                          | `--password=Foo123`   |

### Extracting a dCDR/DCG Backup

Developers and system administrators can manually extract the contents of a backup file (in SanteDB version 3.0 ending with `.bin` ) using the BrainBug tool. The command to extract is:

```
sdb-bb --extract=C:\temp\problem_that_im_diagnosing --bkfile=backup_file_from_tablet.bin --password=Foo123
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.santesuite.org/developers/applets/applet-sdk/santedb-brain-bug.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
