native-profiler-launch-analysis
Measure iOS app launch time or profile startup CPU work to set a baseline, verify a fix, and find what slows the first frame. Requires an installed Release build; it does not build or install the app.
Instructions
Profile or measure iOS app startup. Both modes open the app once, then time the launches that follow.
measure: time five launches with Argent's XCTest runner to set a baseline or verify a fix. On an iPhone the runner must be signed. The metric includes the first frame and any extended launch tasks.
profile: record one Instruments App Launch trace to find the CPU work before the first frame. Work after the first frame is not included. On a simulator there are no lifecycle phases and the launch time is a rough estimate. Install a Release build of bundle_id before calling; the tool does not build or install the app. Use when you need the iOS launch time or want to find what slows the app's startup. Returns samplesCollected in measure mode. In profile mode, launchMs runs from the first lifecycle phase after Process Creation to the first frame (null on a simulator); follow profilerSession.next to load the CPU samples with profiler-load and query them with profiler-stack-query. Fails if the app is not installed or no iPhone or allowed simulator is available.
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": {
"mode": "<mode>",
"bundle_id": "<bundle_id>"
},
"name": "native-profiler-launch-analysis"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | measure: time five launches with XCTest. profile: record one Instruments App Launch trace. | |
| bundle_id | Yes | Bundle ID of the Release build already installed on the device. The tool does not build or install the app. | |
| device_id | No | Connected iPhone UDID; required for a physical-device run. With allow_simulator, a booted simulator UDID also works. | |
| allow_simulator | No | Explicitly allow a booted simulator when no iPhone is selected. Default: false. | |
| duration_seconds | No | profile mode only: App Launch trace recording length in seconds (default 8). Rejected in measure mode. Range: 5 to 60. |