react-profiler-start
Starts a Hermes CPU and React commit profiling session for a selected iOS/Android device, then returns session metadata so you can perform the interaction and stop recording.
Instructions
Record Hermes CPU samples and React commits during an interaction. On an iOS simulator, Android device, call native-profiler-start in parallel on the same target for a combined report, unless the user declines native profiling. After starting, ask the user to perform the interaction to profile, then call react-profiler-stop. Returns { started_at, startedAtEpochMs, hermes_version, detected_architecture }. On iOS and Android, a warning names the apps with native network capture on (started by network-capture-start): their timings in the profile can differ. If a session is already running, returns { already_running: true, mine, owner, … } instead, without clobbering its data, unless it is another tool-server's stale run, has no owner record, or is a lost run of this tool-server: start replaces those. mine: true means this tool-server started the run: if it is yours, call react-profiler-stop. With stale: true it may be another agent's: follow the note. Otherwise, BEFORE OVERTAKING with { force: true }, ask the user for approval first, as how_to_reclaim explains. A start that replaces a run reports it in took_over. Fails if the Hermes runtime is not reachable or the Metro CDP connection cannot be established.
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": "react-profiler-start"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | No | Metro port. Omit it to use this device's port (8081 by default). Ignored for Chromium, whose CDP port is in device_id. Range: 1 to 65535. | |
| force | No | Take over an active profiling session even when it is owned by another tool-server and still fresh. Set to true only when you know the prior owner is gone. Default: false. | |
| device_id | Yes | Device ID from list-devices. For iOS or Android on a shared Metro, use the target's logicalDeviceId if asked to disambiguate. | |
| sample_interval_us | No | CPU sampling interval in microseconds. Default: 100. Must be greater than 0. |