native-profiler-start
Starts native profiling on an iOS or Android app to capture CPU, hangs, jank, memory growth, or leaks so you can reproduce an issue and stop the recording while the app runs.
Instructions
Start native profiling. Instruments records CPU, hangs, and leaks on iOS. Perfetto records CPU, jank, and memory growth on Android. Start the target app first for an attach recording. Wait for this call to return before reproducing the scenario, then call native-profiler-stop while the app is still running. On iOS and Android, a warning names apps whose timings may be affected by native network capture (started by network-capture-start).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"device_id": "<device_id>"
},
"name": "native-profiler-start"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device_id | Yes | Target device id from `list-devices` (iOS UDID or Android serial). | |
| app_process | No | iOS: the CFBundleExecutable or display name of the app to profile. Android: the app's package name. If omitted, auto-detects the foreground app; set it only if auto-detection picks the wrong app. | |
| template_path | No | iOS only. Path to an Instruments .tracetemplate file, or the name of a built-in template such as "Time Profiler" (defaults to the bundled Argent template). | |
| malloc_stack_logging | No | iOS only. Enable allocation stacks from app launch. Restarts the app, clears its current state, and adds CPU and memory overhead. Leave it off for CPU and hang timing. On iOS, attach recordings typically lack allocation stacks. The all-processes capture (including ARGENT_IOS_CAPTURE=all-processes) rejects this option and records no leaks. |