@suite-native/app
Trezor Suite native application.
Prerequisites
Generally it's recommended to follow official React Native environment setup guide.
- Android Guide
- If you have Linux,
watchmancan be installed viaapton debian/ubuntu. Alternatively you may install it via Homebrew for Linux - recommended by watchman, but may cause other issues on Linux.
- If you have Linux,
- iOS Guide
- Make sure you have the latest version of the Xcode command line tools installed:
xcode-select --install
- Make sure you have the latest version of the Xcode command line tools installed:
NixOS prerequisites
shell
USE_ANDROID=1 nix-shell
flakes
nix develop .#use_android
Before you run the app
- Run
yarn native:prebuild:cleanto generateios/andandroid/directories.- You can prebuild for specific platform if you setup only Android/iOS:
yarn prebuild:clean --platform [android|ios] - It's necessary to re-run faster version of this command
yarn native:prebuild(shortcutyarn p) on any change in native code (when you change branch/pull/rebase).
- You can prebuild for specific platform if you setup only Android/iOS:
Running app on Android
- Connect device or run emulator.
- For a physical device, refer to instructions.
- It's recommended to use adb over wifi because you will have free up a USB port to connect Trezor device.
- For a physical device, refer to instructions.
- Run packager -
yarn native:startin separate terminal window and keep it running - Run native build -
yarn native:androidthis takes time (~10min) and it should install and start the app at the end - With emulator running, reverse android emulator ports to enable communication between the app and localhost services -
yarn native:reverse-ports
Running app on iOS
You need a Mac to be able to run the iOS app.
Trezor can't be connected to iOS device via cable, but it's possible to use Portfolio tracker feature for watch only wallets. You will need Xcode and xcode-select.
- Run packager -
yarn native:start - Run
yarn native:iosto build and run the app on iOS Simulator/device
Or via Xcode (for native errors debug):
- Open
suite-native/app/ios/TrezorSuite.xcworkspacein Xcode (from clixed suite-native/app/ios) - Hit the ▶️
Runbutton
It is also possible for development purposes to connect Trezor emulator to iOS Simulator if you turn on the feature flag Connect device in DEV utils.
Connecting a physical Trezor
Once Trezor Suite is running in iOS Simulator / Android emulator, it's possible to use it with a physical Trezor.
- Start desktop version of Trezor Suite that will serve as Trezor Bridge.
- Make sure Trezor emulator is stopped before starting the desktop app.
- Connect a physical Trezor to your laptop and unlock it if necessary.
- You might need to tap the Use Trezor here button and/or reload the app.
Patience might be required but your Trezor should be connected eventually.
Aliases
You can use shorter versions of previous script commands OR navigate to suite-native/app folder and run scripts from there.
Aliases available in root folder:
yarn s= yarn native:startyarn p= yarn native:prebuildyarn ports= yarn native:reverse-portsyarn a= yarn native:androidyarn ios= yarn native:ios
DEV utils
You can show DEV utils on production build FOR DEVELOPMENT PURPOSES ONLY – do not use it for your personal wallets!
To reveal dev menu, you have to click at least 7 times on commit hash at the bottom of About Trezor Suite page.
Environment variables
How our ENV variables works is describe in Environment variables in Expo documentation.
ENV variables for each Expo profile are defined in eas.json config.
You can override ENV variables locally using .env.development.local (or .env.test.local for tests) files.
If you use
.envfile, it has the lowest priority. See what other .env* files you can use.
EXPO_PUBLIC_IS_SENTRY_ON_DEBUG_BUILD_ENABLED=trueto debug Sentry locally andEXPO_PUBLIC_IS_NATIVE_USB_LOGGER_ENABLED=trueto debug @trezor/transport-native-usb locally.EXPO_PUBLIC_IS_NATIVE_BLUETOOTH_LOGGER_ENABLED=trueto debug @trezor/transport-native-bluetooth locally.EXPO_PUBLIC_FF_*overrides initial state for Feature Flags. See .env.development for examples to copy to.env.development.localfile and featureFlagsSlice.ts for all available values.
Native changes - bumping runtimeVersion
Whenever you do a change in a native code (updating native dependency and so on), you have to bump runtimeVersion in app.config.ts file manually so EAS knows that it has to prepare new development build. See Runtime Versions Expo Docs. Hopefully it's just a temporary situation until fingerprint policy is finalized. Fingerprint policy is not working well with development builds yet, waiting for SDK 52.
Troubleshooting
- For any issues with the build, try to clean the project and rebuild it:
yarn native:prebuild:cleanyarn native:androidoryarn native:ios
- In case of issues with the packager, try to restart it with
--reset-cachei.e (yarn s --reset-cache). - If metro crashes after running
yarn starton iOS, try runningwatchman watch-del-allto clear stale file‑watch state. - Sometimes it's helpful to combine two previous points with uninstalling the app from the device/emulator.
- Make sure you are using pure Node or
nvmfor managing node version (other version managers likefnmcan cause build issues on iOS). npx react-native doctormay help to identify issues with your environment, though not every check has to pass- Android emulator on Linux may be unstable with default software renderer. Then go to settings of the Android Virtual Device and choose Graphics acceleration: Hardware.
For further debugging, start emulator withadb logcat -v long > emulator_log.txtrunning somewhere in the background.