Load the app to a Nano S | Developers

Load the app to a Nano S

Estimated reading time: 4 minutes

Tip
The Nano X does not support side loading, therefore you must use the device emulator Speculos for loading to work. See how to install and use it. For the Nano S, you can read the following instructions.
Important
If you are a Mac or a Windows user, you should use a Linux Virtual Machine to load the application to a Nano S.

1. Define the udev rules

If you wish to load applications on your device, you will need to add the appropriate udev rules.

wget -q -O - https://raw.githubusercontent.com/LedgerHQ/udev-rules/master/add_udev_rules.sh | sudo bash

2. Load the application from inside the container image

Important
If you want to load and delete the app directly from the container image. You need to compile the application, in the source file of your application, adding the --privileged option:
$ sudo docker run --rm -ti -v "/dev/bus/usb:/dev/bus/usb" -v "$(realpath .):/app"
--privileged ledger-app-builder:latest

While de container image is running:

  1. Plug and unlock the Nano S.
  2. Use make load to load the app to the Nano S and make delete to delete it.
  3. You can exit the image, with the command exit.

2. … or load the application with ledgerblue

2.1. Install ledgerblue

ledgerblue is a package that contains Python tools to communicate with Ledger devices and manage applications life cycle. It is recommended to install this package in a Virtual Environment in your native environment (not a Docker image) to avoid hidapi issues.

Prerequisited packages

First, make sure you have installed the prerequisited packages:

  • libudev-dev
  • libusb-1.0-0-dev
  • python-dev (python 2.7)
  • virtualenv

ledgerblue package

Outside of your application folder, install the ledgerblue package in a virtual environment:

virtualenv ledger
source ledger/bin/activate
pip install ledgerblue
deactivate

2.2. Load and delete

Clone the SDK

Important
The Nano S SDK must first be locally cloned and stored in BOLOS_SDK for the loading to work.

Use the following commands:

git clone https://github.com/LedgerHQ/nanos-secure-sdk.git nanos-secure-sdk
export BOLOS_SDK=<path-to>nanos-secure-sdk

How-to

  1. Plug and unlock the Nano S.
  2. Move to the root of the application file and activate the virtual environment with source ledger/bin/activate.
  3. Use make load to load the app to the Nano S and make delete to delete it.
  4. You can deactivate the virtual environment with the command deactivate.
Note
Before loading an application, make sure you have enough space on the device.

Did you find this page helpful?


How would you improve this page?



Build the application
Automatic firmware applications opening / closing
Getting Started
Theme Features
Customization