Using VS Code configuration files (inside
.vscode), Suite Desktop can be built and run with a debugger attached to it. Running the
Suite-Desktop: App task (F5) will execute all required scripts (NextJS server + Electron build) and launch the Electron app. VS Code will be set in debugging mode, allowing you, for example, to set breakpoints and inspect variables inside the
electron-src folder (as well as other dependencies). For more on Debugging, please refer to the VS Code documentation.
Known issue: The devtools might blank out at launch. If this happens, simply close and re-open the devtools (CTRL + SHIFT + I).
Logging can be enabled by running Suite with the command line flag
--log-level=LEVEL (replace LEVEL with error, warn, info or debug based on the logging you wish to display). Additional command line flags can be found below.
More technical information can be found on the Desktop Logger page.
Runtime flags can be used when running the Suite Desktop executable, enabling or disabling certain features. For example:
./Trezor-Suite-20.10.1.AppImage --disable-csp will run with this flag turned on, which will result in the Content Security Policy being disabled.
|Disables the Content Security Policy. Necessary for using DevTools in a production build.|
|Tells the auto-updater to fetch pre-release updates.|
|Instruct Bridge to support emulator (starts Bridge with |
|Set the logging level. Available levels are [name (value)]: error (1), warn (2), info(3), debug (4). All logs with a value equal or lower to the selected log level will be displayed.|
|Write log to disk|
|Disable the log priting in the console.|
|Name of the output file (defaults to |
|Path for the output file (defaults to home or current working directory)|
|Enables the auto updater (if disabled in feature flags)|
|Disables the auto updater (if enabled in feature flags)|
Some libraries are difficult to test in development environments, such as the auto-updater. In order to still allow certain interactions with the feature in developments, libraries can be mocked.
- By default, development builds load mocks.
- Non-development builds can include mocks if the
USE_MOCKSenvironment variable is defined.
- Open the suite-desktop build script located at
- Add a new entry to the
mocksobject. The key should be the name of the package, exactly as written when imported. The value should be the path to the mock file to point to (located in
- Create the file in
/packages/suite-desktop/src-electron/mocksand export mocked properties that you have imported across the project.
The auto-updater has been mocked to simulate similar behaviour to the actual library. Unless the commandline parameter
--mock-trigger-updater-after=DELAY is passed, checking for updates will always return
not-available. This commandline parameter requires a value, representing a delay in seconds before making the update available. Using
0 as a value will make the update available immediately. For example, if you wish to make an update available after 1 minute, you will use the parameter as follows:
--mock-trigger-updater-after=60. Note that his parameter is ONLY available with mocks enabled.