-
Notifications
You must be signed in to change notification settings - Fork 332
LLD:DeepLinking:TestAndDebug
-> go this way when you are in active dev of the deeplink & debugging to have quick iterations
In the devtools console :
let remote = require('@electron/remote')
let win = remote.getCurrentWindow()
win.send('deep-linking','ledgerlive://what/you/want')
-> go this way when it mostly works, but you want to test/debug real integration.
In order to test (and debug) deep linking on LLD, you need to build the app (except if you are on windows theoretically), cf. this page from the Electron doc.
You will also need to replace your installed Ledger Live version by the locally built one.
Here are the steps (for mac, should be similar for other OS):
- build LLD (by running
pnpm build:lld
at the root of theledger-live
repo) - [OPTIONAL] backup your
app.json
file located under/Users/[USERNAME]/Library/Application Support/Ledger Live/app.json
to another location (just in case) - copy your locally built Ledger Live app to the default Applications folder:
\cp -r apps/ledger-live-desktop/dist/mac-universal/Ledger\ Live.app /Applications/
- open a deeplink (such as
ledgerlive://discover/lido
) - this should open the Live on the appropriate page (depending in deeplink used for test)
If you need to debug the behaviour happening with deeplinks, as of today your only tool is logging.
Note: since the app is built and run in prod environement, for your logs to be visible, you need to use logger.log()
from ~/logger
instead of traditionnal console.log()
.
Here is a quick step by step guide:
- spray the sucpitious code / code you want to investigate with logs
- it's best to start from the root of deeplinks, ie:
apps/ledger-live-desktop/src/renderer/hooks/useDeeplinking.js
- it's best to prefix your logs with a unique / recognisable patter such as
"TEST --- "
to ease retrieving thems in the logfile - as with any logs, you can add additional objects to check their value
logger.log("TEST --- functionA", { objectA });
- it's best to start from the root of deeplinks, ie:
- build the app and test (cf. steps above)
- extract the logs from the app (either through the settings or through the "save logs" button of the error screen if the app has crashed)
- open the logs file in your favorite editor and search for your debug logs to investigate
- rince and repeat until you isolate the root cause of your issue
Note:
One might want to take a deeper look at this issue to enable local developement test and debugging of deeplinks 🔍
- Ledger Live Desktop
- Ledger Live Mobile
-
Ledger Live Common
- Introduction
- Currency Models
- Currency Bridge
- Account
- Account Bridge
- apps
- appsCheckAllAppVersions
- ledger-live bot
- Canonical Ways to Investigate Bugs
- Coin Integration Introduction
- Countervalues
- Packages Duplicates
- Derivation
- Developing with CLI
- Developing
- Gist Firmware Update
- Gist Transaction
- Hardware Wallet Logic
- Socket
- Assorted tips
- Integration Tests
- Process
- Monorepository Migration Guide
- Issues, Workaround and Tricks
- Common CI Troubleshooting
- Create staging builds using the CI
- Deprecated