How to port a device app to Ledger Nano Gen5
This guide shows you how to make an existing device app build, display, and test on Ledger Nano Gen5. The device target name is apex_p.
Contact your usual Ledger contact if you are not sure you should make this change. The worked examples are the boilerplate updates: C boilerplate pull request 158Â and Rust boilerplate pull request 154Â .
Step 1: Add the two icons
Create two black-and-white PNG icons:
- 48 by 48 pixels, saved as
glyphs/app_yourcoin_48px.png - 32 by 32 pixels, saved as
icons/app_yourcoin_32px.png
Step 2: Register the target
For a C application, set the 32-pixel icon in the Makefile:
ICON_APEX_P = icons/app_yourcoin_32px.pngFor a Rust application, add the apex_p package metadata in cargo.toml:
[package.metadata.ledger.apex_p]
icon = "icons/app_yourcoin_32px.png"
# ...
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("apex_p", "stax", "flex", "nanos", "nanox", "nanosplus"))'] }For both languages, add apex_p to devices in ledger_app.toml:
devices = ["nanox", "nanos+", "stax", "flex", "apex_p"]Step 3: Add tests for apex_p
Every device listed under [app].devices in ledger_app.toml must have functional tests. Ragger maps the apex_p entry to the pytest device value apex_p. Run the suite for that device:
pytest <test_dir>/ --tb=short -v --device apex_p<test_dir> is the directory in ledger_app.toml under [pytest.standalone].directory. Use --golden_run only when you are creating the Nano Gen5 screen snapshots. The rest of the test rules, including the device-name table, are in TEST.instructions.md .
Step 4: Publish the target
Add apex_p for your app in the Ledger app database . Then submit the update with the submission form.
The app now builds for Nano Gen5, its tests run with --device apex_p, and the database lists the target. Use the boilerplate pull requests above if a file in your tree does not match these snippets.