.NET Startup Profiling (Beta)

Prepare .NET Android and iOS artifacts for the beta Ansight startup, CPU, GC, JIT, exception, thread, and call-tree profiling workflow.

Beta feature. Profiling commands and the preparation package are experimental and may change before general availability. Profiling commands are omitted from default CLI help; run ansight help --beta to include them.

Ansight.Profiling.DotNet prepares an already-built .NET Android or iOS application artifact for profiling by the Ansight CLI. It configures the target diagnostic endpoint, embeds the target manifest that Ansight validates before launch, and exposes an exact application-ready marker.

The package does not build, publish, sign, or modify the application. Use a dedicated profiling configuration owned by the app.

Install and Enable

dotnet add package Ansight.Profiling.DotNet --version 1.5.0
<PropertyGroup Condition="'$(Configuration)' == 'Profile'">
  <AnsightProfilingEnabled>true</AnsightProfilingEnabled>
  <AnsightProfilingTarget>android-emulator</AnsightProfilingTarget>
</PropertyGroup>

Supported targets are:

  • android-emulator
  • android-device
  • ios-simulator
  • ios-device

Call the marker when the first usable application screen is ready:

using Ansight.Profiling;

AnsightProfiler.ApplicationReady();

The call is idempotent. Without it, startup analysis falls back to runtime and trace-boundary milestones.

Capture

Build the artifact with the profiling configuration, then use its package or bundle identifier and an exact device:

ansight profile dotnet tools
ansight profile dotnet start ./MyApp.apk \
  --app-id com.example.myapp \
  --device-id emulator-5554 \
  --duration-seconds 30 \
  --wait

The CLI supports .app, .apk, and .ipa artifacts. Use --symbols to retain portable PDBs with the capture when symbolication requires them.

Analyze

ansight profile dotnet overview <capture-id>
ansight profile dotnet startup <capture-id>
ansight profile dotnet cpu <capture-id>
ansight profile dotnet call-tree <capture-id>
ansight profile dotnet threads <capture-id>
ansight profile dotnet gc <capture-id>
ansight profile dotnet jit <capture-id>
ansight profile dotnet exceptions <capture-id>
ansight profile dotnet speedscope <capture-id>

Analysis commands support time-window and process/thread filters. See the CLI command reference for every capture and analysis option.