Skip to content

native-profiler-stop can't find the session created by native-profiler-start (iOS sim) #248

@csori99

Description

@csori99

Hey, ran into this while profiling a React Native app on the iOS simulator and wanted to flag it.

native-profiler-start works fine (xctrace spawns, starts recording, returns a pid and a trace path). But native-profiler-stop always fails with No active native profiling session found. Call native-profiler-start first., so I can never export a trace through the tool.

Dug into it a bit:

  • After calling start, the xctrace process stays alive. I watched it from a plain shell (no argent tool calls in between) for 6+ seconds and it kept running and recording.
  • Calling stop after that still says "no active session", and the xctrace process gets killed right around then.
  • So start and stop don't seem to share the same session state. stop looks like it resolves a fresh/empty session (profilingActive is false) instead of the one start created, and the real session gets disposed (dispose() SIGKILLs the live xctrace).

Only one tool-server.cjs and one argent mcp process running, so it's not a duplicate-instance thing. Happens whether or not there are other tool calls (gesture-tap, screenshot) in between.

Repro:

  1. Boot an iOS simulator with an app running.
  2. native-profiler-start (succeeds, recording).
  3. interact or just wait a few seconds.
  4. native-profiler-stop -> "No active native profiling session found".

Expected: stop finds the active session and exports the trace.
Actual: stop never finds it, and the recording gets killed.

Environment:

  • argent 0.8.0 (also reproduced on 0.7.1)
  • macOS, Xcode 26.4, xctrace 16.0
  • iOS 26.4 simulator, React Native app (bridgeless, Hermes)

One side note in case it is related: running xctrace directly with the bundled Argent.tracetemplate records ok but won't finalize/package the trace on stop (it hangs, and the bundle is incomplete so export fails with "Document Missing Template Error"). Not sure if that is the same underlying issue or a separate xctrace/simulator thing on this machine, but the start/stop session mismatch above reproduces on its own.

The react profiler tools work great by the way, this is just the native side.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions