mirror of
https://github.com/status-im/status-app.git
synced 2026-08-27 15:11:20 +00:00
1.8 KiB
1.8 KiB
Mobile profiling (Android)
make mobile-profile builds and launches a profile-mode Android APK that
blocks at QML engine creation waiting for a profiler/debugger on
localhost:49152. The profile APK installs over the mobile-run debug
install (same package id), so a single Status flavor stays on the device.
iOS profiling and Android Studio "Go to source" are not implemented yet.
What it enables
| Layer | Change |
|---|---|
| Qt engine | Engine binds + blocks on QML_DEBUG_PORT (default 49152). |
| Nim | -d:release -d:nimTypeNames (so Android Studio resolves Nim frames). |
| adb | adb forward tcp:$PORT tcp:$PORT set up automatically. |
| Gradle | profile build type: debuggable=false, profileable=true. |
Override the port with QML_DEBUG_PORT=NNNN make mobile-profile.
Workflow
- Connect a device (or set
ANDROID_SERIAL). - Run
make mobile-profile(same env asmake mobile-run). When you seeApp started with PID: …, the app is blocked waiting for a QML client. - (Optional) Attach Android Studio CPU profiler: View → Tool Windows → Profiler → pick the PID → CPU. Start recording before releasing the QML block to capture startup.
- Attach a QML profiler to release the block:
- CLI:
qmlprofiler -attach localhost:49152 - Qt Creator: Analyze → QML Profiler → Attach to Waiting Application
→
localhost:49152. Pick the desktop kit.
- CLI:
You can run both profilers concurrently — attach Android Studio first while the app is still blocked, then release with the QML side.
To switch back to a normal run, just make mobile-run.