argent-native-profiler
1. Tools and platforms
native-profiler-start→native-profiler-stop→native-profiler-analyze: record, export, and report.profiler-stack-query: drill into the analyzed data (hang stacks, function callers, thread breakdown, leaks).profiler-load: reload an earlier session from disk.
iOS (Instruments via xctrace): simulator only; a physical iPhone is not supported. Needs full Xcode (xcrun xctrace version). Reports CPU hotspots, UI hangs and memory leaks.
Android (Perfetto): emulator or physical device. Reports CPU hotspots and UI hangs (with jank reasons and the main thread's blocking function), plus an RSS-growth signal for memory pressure: treat it as a hint to confirm, not a confirmed leak. The app must be debuggable or declare <profileable android:shell="true"/> in its manifest, or no perf_sample callstacks are captured.
For Mac apps (platform: "macos"), use Instruments with full Xcode. If start returns NATIVE_PROFILER_APP_NOT_DEBUGGABLE, use a development-signed build. In a background session such as SSH, template_path: "Time Profiler" also works for CPU and hangs on a signed build without the debugging entitlement. Do not sign files or add entitlements.
If native-profiler-start returns NATIVE_PROFILER_APP_HAS_WEBKIT_HEAP or NATIVE_PROFILER_APP_HEAP_CHECK_FAILED on a Mac app, choose the retry based on what you need to measure.
- For CPU and hangs, use
template_path: "Time Profiler"to keep the app running in its current state. - For leaks, use the bundled template with
malloc_stack_logging: true, even for allocations made during the recording. Save any state you need before retrying because this restarts the app.
While logging is off, avoid Leaks, Allocations, and other templates that use the Allocations instrument on these apps. They can freeze the app.