|
| 1 | +--- |
| 2 | +description: Trezor hardware emulator for dev purposes |
| 3 | +--- |
| 4 | + |
| 5 | +import ZoomableIllustration from '../../components/ZoomableIllustration'; |
| 6 | + |
| 7 | +# Using Trezor Hardware Emulator |
| 8 | + |
| 9 | +When developing and testing your Trezor integration, you don't necessarily need a physical hardware wallet. The Trezor hardware emulator allows you to fully test your integration in a local development environment without the need for actual devices. |
| 10 | + |
| 11 | +<ZoomableIllustration |
| 12 | + src="/images/emulator-and-control-panel.png" |
| 13 | + alt="Emulator and control panel screenshot" |
| 14 | +/> |
| 15 | + |
| 16 | +### Getting Started with Trezor User Env |
| 17 | + |
| 18 | +The easiest way to run a Trezor hardware emulator is using [trezor-user-env](https://github.com/trezor/trezor-user-env), a comprehensive testing environment for Trezor hardware wallets. |
| 19 | + |
| 20 | +### Prerequisites |
| 21 | + |
| 22 | +- Docker (on Linux, you need to be able to run it as non-root user, follow [those steps](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user)) |
| 23 | +- xhost on Linux |
| 24 | +- [XQuartz](https://www.xquartz.org/) on macOS. Configure > Preferences > Security > Allow connections from network clients |
| 25 | +- Reboot (sign out/sign in might work) |
| 26 | + |
| 27 | +### Steps |
| 28 | + |
| 29 | +1. Clone this repo and enter the directory |
| 30 | +2. Run `./run.sh` - it will determine your platform and launch trezor-user-env. See `./run.sh --help` for some additional arguments. |
| 31 | +3. Open http://localhost:9002. |
| 32 | + |
| 33 | +``` |
| 34 | +git clone https://github.com/trezor/trezor-user-env.git |
| 35 | +cd trezor-user-env |
| 36 | +./run.sh |
| 37 | +``` |
| 38 | + |
| 39 | +### Connection Issues |
| 40 | + |
| 41 | +In case you have installed Trezor Bridge (no longer supported) previously there will be a port conflict, please make sure it is not running. Either uninstall it completely or stop the service. |
| 42 | + |
| 43 | +Also Trezor Bridge port might be occupied by Trezor Suite application if it is running (possibly on background). Trezor Suite normally relies on it's own bundled Bridge. To use the Bridge from trezor-user-env instead, you need to disable the bundled Bridge in Suite's debug settings. |
| 44 | + |
| 45 | +1. To enable debug settings, open Trezor Suite -> Settings and 5x click on the "Settings" title at the top of the page. |
| 46 | +1. Go to the "Debug" tab, scroll down to "Transport backends" and disable "Bridge server". |
| 47 | +1. Also disable "Run on startup" if you want to remember this setting for next launches of Suite. |
| 48 | +1. If you want to use a real device again, make sure to re-enable the "Bridge server" option. |
0 commit comments