react-profiler-start
Initiates CPU profiling and React commit capture on a Hermes runtime. Manages session ownership conflicts, returning status or allowing forced takeover.
Instructions
Start CPU profiling + React commit capture on the connected Hermes runtime. Delegates React commit capture to the in-app React DevTools backend (ri.startProfiling). If another tool-server already owns the session, returns { already_running: true, owner, stale, how_to_reclaim } without clobbering their data. Pass { force: true } to reclaim a fresh owner's session, but BEFORE OVERTAKING - ask the user for approval first, see relevant skill for guidance. Before calling this, ask the user if they also want native profiling (native-profiler-start) — recommend running both in parallel for a complete picture. 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 success, or the already_running payload described above. Fails if the Hermes runtime is not reachable or the Metro CDP connection cannot be established.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | No | Metro server port | |
| 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. | |
| device_id | Yes | Device logicalDeviceId from debugger-connect (iOS simulator UDID or Android logicalDeviceId). | |
| sample_interval_us | No | CPU sampling interval in microseconds (default 100) |