---
title: Device app development framework
category: reference
agent_config:
  entry_point:
    label: Agent Instructions
    url: https://raw.githubusercontent.com/LedgerHQ/ledger-app-ai-instructions/master/CLAUDE.md
    role: orchestrator
  instruction_files:
    - label: Embedded Constraints
      url: https://raw.githubusercontent.com/LedgerHQ/ledger-app-ai-instructions/master/instructions/EMBEDDED.instructions.md
      scope: "*.c, *.h, *.rs"
    - label: C Rules
      url: https://raw.githubusercontent.com/LedgerHQ/ledger-app-ai-instructions/master/instructions/C.instructions.md
      scope: "*.c, *.h"
    - label: Rust Rules
      url: https://raw.githubusercontent.com/LedgerHQ/ledger-app-ai-instructions/master/instructions/RUST.instructions.md
      scope: "*.rs"
    - label: Test Rules
      url: https://raw.githubusercontent.com/LedgerHQ/ledger-app-ai-instructions/master/instructions/TEST.instructions.md
      scope: "*.py"
    - label: Review Checklist
      url: https://raw.githubusercontent.com/LedgerHQ/ledger-app-ai-instructions/master/instructions/REVIEW.instructions.md
      scope: "*"
---

## Agent Instructions

**Entry point:** [Agent Instructions](https://raw.githubusercontent.com/LedgerHQ/ledger-app-ai-instructions/master/CLAUDE.md) (orchestrator)

### Instruction Files

- [Embedded Constraints](https://raw.githubusercontent.com/LedgerHQ/ledger-app-ai-instructions/master/instructions/EMBEDDED.instructions.md) — scope: `*.c, *.h, *.rs`
- [C Rules](https://raw.githubusercontent.com/LedgerHQ/ledger-app-ai-instructions/master/instructions/C.instructions.md) — scope: `*.c, *.h`
- [Rust Rules](https://raw.githubusercontent.com/LedgerHQ/ledger-app-ai-instructions/master/instructions/RUST.instructions.md) — scope: `*.rs`
- [Test Rules](https://raw.githubusercontent.com/LedgerHQ/ledger-app-ai-instructions/master/instructions/TEST.instructions.md) — scope: `*.py`
- [Review Checklist](https://raw.githubusercontent.com/LedgerHQ/ledger-app-ai-instructions/master/instructions/REVIEW.instructions.md) — scope: `*`

# Device app development framework

Ledger maintains a set of repositories that, together, give you everything you need to **build**, **test**, **load**, and **submit** a Ledger device application. This page lists each tool, what it does, and when to reach for it.

## At a glance

| Tool                                                                                                                 | What it gives you                                                            | Languages    | OS support              |
| -------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ------------ | ----------------------- |
| [`ledger-app-ai-instructions`](https://github.com/LedgerHQ/ledger-app-ai-instructions)                               | Reusable `CLAUDE.md` / Copilot instruction files for AI-assisted development | —            | GitHub                  |
| [`app-boilerplate-rust`](https://github.com/LedgerHQ/app-boilerplate-rust)                                           | Forkable Rust application skeleton (mandatory for new apps)                  | Rust         | Linux / macOS / Windows |
| [`app-boilerplate`](https://github.com/LedgerHQ/app-boilerplate)                                                     | Forkable C application skeleton (existing C projects)                        | C            | Linux / macOS / Windows |
| [`app-plugin-boilerplate`](https://github.com/LedgerHQ/app-plugin-boilerplate)                                       | Forkable Ethereum-app plugin skeleton                                        | C            | Linux / macOS / Windows |
| [`ledger-dev-tools` VSCode extension](https://marketplace.visualstudio.com/items?itemName=LedgerHQ.ledger-dev-tools) | One-click build / test / load from the IDE                                   | UI           | Linux / macOS / Windows |
| [`speculos`](https://github.com/LedgerHQ/speculos)                                                                   | Emulator for Nano S+, Nano X, Stax, Flex, Nano Gen5                          | Python (CLI) | Linux / macOS / WSL     |
| [`ragger`](https://github.com/LedgerHQ/ragger)                                                                       | `pytest`-based functional test framework                                     | Python       | Linux / macOS / Windows |
| [`ledger-app-workflows`](https://github.com/LedgerHQ/ledger-app-workflows)                                           | Reusable GitHub Actions workflows                                            | YAML         | GitHub Actions          |
| [`ledger-app-builder`](https://github.com/LedgerHQ/ledger-app-builder)                                               | Docker images with the toolchain pre-installed                               | Docker       | Linux / macOS / Windows |

## When to pick which

### Starting a new app

Fork **one of the boilerplates**:

- `app-boilerplate-rust`: **mandatory for new apps.** Comes with Rust unit tests, Ragger functional tests, CI workflows, and a `Cargo.toml` already wired to the SDK.
- `app-boilerplate`: C application skeleton for existing C projects. Comes with C unit tests (cmocka), Ragger functional tests, CI workflows, and a `Makefile` already wired to the SDK.
- `app-plugin-boilerplate`: only for **Ethereum-app plugins** (Clear Signing for an EVM contract). Different lifecycle: a plugin runs alongside the Ethereum app, not as a standalone app.

### Building locally

Pick one of:

- **VSCode + [`ledger-dev-tools`](https://marketplace.visualstudio.com/items?itemName=LedgerHQ.ledger-dev-tools)**: the recommended path on macOS and Windows. The extension launches the `ledger-app-dev-tools` Docker image behind the scenes and exposes Build / Run with Speculos / Run tests / Load on device as IDE tasks.
- **Docker images from [`ledger-app-builder`](https://github.com/LedgerHQ/ledger-app-builder)**, in three flavours:
  - `ledger-app-builder-lite` (C only),
  - `ledger-app-builder` (default, C + Rust),
  - `ledger-app-dev-tools` (full image with Speculos and Ragger; what the VSCode extension uses).
- **Bare host with the SDK directly**: works for advanced users on Linux who already have ARM toolchains; see the [SDK README](https://github.com/LedgerHQ/ledger-secure-sdk).

For each device target you set the matching `BOLOS_SDK` variable: `$NANOX_SDK`, `$NANOSP_SDK`, `$STAX_SDK`, `$FLEX_SDK`, or `$APEX_SDK`.

### Running and emulating

[`Speculos`](https://github.com/LedgerHQ/speculos) emulates Nano S+, Nano X, Stax,and Flex on a desktop computer; install with `pip install speculos` and run, for example:

```bash
speculos --model nanosp build/nanos2/bin/app.elf
```

Caveats from the Speculos README to keep in mind:

- It implements only the subset of syscalls common apps use (no app-install, firmware-update, or OS-info syscalls).
- Memory-alignment behaviour differs from a real Nano S+ device.
- The internal watchdog enforced on Nano X / Flex / Nano Gen5 / Stax is not emulated.

### Writing functional tests

[`Ragger`](https://github.com/LedgerHQ/ragger) gives a single `pytest` interface that runs the same tests against three backends (Speculos, `LedgerComm`, and `LedgerWallet`), so you can switch between emulator and physical device with a flag:

```bash
pytest <tests/path>                                   # Speculos by default
pytest --backend ledgerwallet <tests/path>            # against a connected device
```

Install with `pip install 'ragger[all_backends]'`. The `app-boilerplate` repo ships an example suite you can copy.

### Continuous integration

[`ledger-app-workflows`](https://github.com/LedgerHQ/ledger-app-workflows) provides reusable GitHub Actions workflows:

- `guidelines_enforcer.yml`: checks your repo against Ledger's published app guidelines. Passing this workflow is a **mandatory** step to be listed on the Ledger app store.
- Build-and-test workflows that build the app for every supported device and run the Ragger suite on Speculos.

The boilerplates already wire these in.

## Putting it together

A typical project layout uses these tools as follows:

1. Fork the right boilerplate: `app-boilerplate-rust` for new apps, `app-boilerplate` for existing C apps, or `app-plugin-boilerplate` for Ethereum plugins.
2. Develop locally in VSCode with `ledger-dev-tools`, or directly with `ledger-app-builder` Docker images.
3. Run the app interactively in Speculos and write Ragger tests as features land.
4. Push to GitHub; the workflows from `ledger-app-workflows` build for every device, run the Ragger suite on Speculos, and run the guidelines enforcer.
5. When green, follow the [submission process](../submission-process/process) to ship the app through the Ledger Manager.

## See also

- [Get started](../getting-started): set up a development environment and build your first app.
- [Submission process](../submission-process/process): how an app reaches end users.
- [Architecture](../explanation/architecture-diagram): where the device app fits in the wider system.
- [Ledger Secure SDK](https://github.com/LedgerHQ/ledger-secure-sdk): the underlying SDK referenced by `BOLOS_SDK`.
