Manual testing and debugging
December 2, 2025 ยท View on GitHub
Debug login
In order to simplify login during debug session Debug login button provided in gui (debug mode only).
Please create assets/debug_data.json file with wallet credentials to use it.
File structure example bellow:
{
"wallet": {
"name": "wasmtest",
"password": "debugpassword",
"seed": "test seed phrase please change with your actual debug seed",
"activated_coins": ["RICK", "MORTY"],
"automateLogin": true
},
"swaps": {
"import": []
}
}
Manual testing
Debugging web version on desktop
HTTP
flutter run -d chrome --web-hostname=0.0.0.0 --web-port=7777
HTTPS
Generate self-signed certificate with openssl
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha512 -days 3650 -nodes -subj "/C=XX/ST=StateName/L=CityName/O=CompanyName/OU=CompanySectionName/CN=http://localhost.com"
Run flutter with self-signed certificate
flutter run -d chrome --web-hostname=0.0.0.0 --web-port=7777 --web-tls-cert-key-path=key.pem --web-tls-cert-path=cert.pem
Or as a standalone web server for use with any browser:
flutter run -d web-server --web-hostname=0.0.0.0 --web-port=7777 --web-tls-cert-key-path=key.pem --web-tls-cert-path=cert.pem
Debugging web version on physical mobile devices
Since app behavior in mobile browser on physical device may differ from its behavior in Chrome Desktop mobile emulator, sometimes it is necessary to run local app build on a physical mobile phone.
Mac + iPhone
- On your mac:
1.2. Plug in your iPhone to Mac with cable
1.3. Go to System Preferences -> Sharing
1.4. Uncheck 'Internet Sharing' checkbox on the left side, if checked
1.5. Check 'iPhone USB' checkbox on the right
1.6. Check 'Internet Sharing' checkbox on the left again
1.7. At the top of the window you'll see message, similar to 'Computers on your local network can access your computer at: %yourMacName%.local'. You can press 'Edit' button and change
%yourMacName%with shorter value. 1.8. Runflutter run -d web-server --web-hostname 0.0.0.0 --web-port 53875in project directory. You can use different port if needed. - On your iPhone:
2.1. Open Safari
2.2. Switch to 'Private' mode (to avoid caching)
2.3. Enter
%yourMacName%.local:53875in the address bar (%yourMacName%.localis the value from 1.7, port is from 1.8) 2.4. You should see app running in your mobile browser
More platforms TBD
Useful for testing
-
Server for static files on node.js:
const express = require("express"); const path = require("path"); var app = express(); app.use(express.static(path.join(__dirname, "/build/web"))); app.get("/", (req, res) => { res.sendFile(path.join(__dirname, "/build/web/index.html")); }); app.listen(53875); -
Change
updateCheckerEndpointinlib/app_config/constants.dartto use your custom version checker endpoint -
Decrease time for checking of version, see
initmethod inupdate_bloc.dart
To create a recoverable swap
At the time of writing used branch gen-recoverable-swap
-
Setup atomicDex-API, see
-
Setup dev environment, see
-
Run command below
BOB_PASSPHRASE="seedphrase1" ALICE_PASSPHRASE="seedphrase2" TAKER_FAIL_AT="taker_payment_refund" MAKER_FAIL_AT="taker_payment_spend" cargo test --package mm2_main --lib mm2::lp_swap::lp_swap_tests::gen_recoverable_swap -- --exact --ignored --nocapture -
In the end of test you should see in the console JSON-files with swaps data
Maker swap path <kdf-repo>/mm2src/mm2_main/DB/<maker-pubkey>/SWAPS/MY/<swap-uuid>.json Taker swap path <kdf-repo>/mm2src/mm2_main/DB/<taker-pubkey>/SWAPS/MY/<swap-uuid>.json -
Copy swap with for your seedphrase to 'assets/debug_data.json', see Debug Login
-
Run Gleec Wallet in debug mode and click 'Debug Login' button in the top right corner
-
Imported swaps should appear in history on the DEX page
Explanation for env variables:
- ALICE_PASSPHRASE uses for taker
- BOB_PASSPHRASE uses for maker
- TAKER_FAIL_AT values see here
- MAKER_FAIL_AT values see here
iOS Crash Logs
Look for entries starting with or containing "Runner" or "GLEEC"
- On a real device: Go to Settings -> Privacy -> Analytics & Improvements -> Analytics Data
- In Simulator: ~/Library/Logs/DiagnosticReports/
Visual Studio Code Configuration
launch.json
Replace $HOME with your home directory if there are any issues with the path.
{
"version": "0.2.0",
"configurations": [
{
"name": "GW (debug)",
"program": "lib/main.dart",
"request": "launch",
"type": "dart",
"args": ["--web-port", "6969"]
},
{
"name": "GW (debug,https)",
"program": "lib/main.dart",
"request": "launch",
"type": "dart",
"args": [
"--web-port",
"6970",
"--web-tls-cert-path",
"$HOME/.ssh/debug/server.crt",
"--web-tls-cert-key-path",
"$HOME/.ssh/debug/server.key"
]
},
{
"name": "GW (debug,https,no-web-security)",
"program": "lib/main.dart",
"request": "launch",
"type": "dart",
"args": [
"--web-port",
"6971",
"--web-browser-flag",
"--disable-web-security",
"--web-tls-cert-path",
"$HOME/.ssh/debug/server.crt",
"--web-tls-cert-key-path",
"$HOME/.ssh/debug/server.key"
]
},
{
"name": "GW (profile)",
"program": "lib/main.dart",
"request": "launch",
"type": "dart",
"flutterMode": "profile",
"args": ["--web-port", "6972"]
},
{
"name": "GW (profile,https)",
"program": "lib/main.dart",
"request": "launch",
"type": "dart",
"flutterMode": "profile",
"args": [
"--web-port",
"6973",
"--web-tls-cert-path",
"$HOME/.ssh/debug/server.crt",
"--web-tls-cert-key-path",
"$HOME/.ssh/debug/server.key"
]
},
{
"name": "GW (release)",
"program": "lib/main.dart",
"request": "launch",
"type": "dart",
"flutterMode": "release",
"args": ["--web-port", "8080"]
},
{
"name": "GW (release,https)",
"program": "lib/main.dart",
"request": "launch",
"type": "dart",
"flutterMode": "release",
"args": [
"--web-port",
"8081",
"--web-tls-cert-path",
"$HOME/.ssh/debug/server.crt",
"--web-tls-cert-key-path",
"$HOME/.ssh/debug/server.key"
]
}
]
}
settings.json
{
"dart.flutterSdkPath": ".fvm/versions/stable",
"[dart]": {
"editor.defaultFormatter": "Dart-Code.dart-code",
"editor.formatOnSave": true
}
}