Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Build instructions for Emulator (Unix port)

Hint: Using emulator as described here is useful during firmware development. If you intend to use the emulator without modifying the firmware, you might be looking for Trezor User Env.

Complete the setup (nix-shell + uv) described in index.md before proceeding.

Manual Requirements Installation

If you prefer not to use nix-shell, install the following dependencies manually:

  • Debian/Ubuntu:
sudo apt-get install libsdl2-dev libsdl2-image-dev llvm-dev libclang-dev clang
  • Fedora:
sudo yum install SDL2-devel SDL2_image-devel clang-devel
  • OpenSUSE:
sudo zypper install libSDL2-devel libSDL2_image-devel
  • Arch:
sudo pacman -S sdl2 sdl2_image clang-devel
  • Mac OS X:
brew install sdl2 sdl2_image pkg-config llvm
  • Windows: not supported yet, sorry.

You will also need the protocol buffer compiler protoc. Follow the installation instructions for your system.

And Rust (currently 1.96 nightly) via rustup:

rustup default nightly
rustup update

The bindgen crate requires libclang for generating MicroPython FFI.

Build

Most xtask commands require specifying the model via the --model or -m option. You can select one of the following models:

  • t2t1 - Model T
  • t3b1 - Trezor Safe 3
  • t3t1 - Trezor Safe 5
  • t3w1 - Trezor Safe 7

Run the build with:

xtask build firmware --emulator -m t2b1

Run

Now you can start the emulator:

./emu.py

The emulator has a number of interesting features all documented in the Emulator section.