instruments-profiling
Qué hace
Esta skill muestra cómo grabar una traza del Time Profiler de una app nativa de Apple y abrirla en Instruments. Está pensada para desarrolladores que investigan apps nativas lentas o muy pesadas.
Cuándo usarla
- ✓Cuando una app de macOS o iOS va lenta y necesitas ver en qué se gasta el tiempo.
- ✓Cuando necesitas una traza de una compilación concreta de la app y no de otra copia.
- ✓Cuando quieres una grabación de rendimiento de una app desde la línea de comandos.
Link de la skill
https://github.com/steipete/agent-scripts/blob/main/skills/instruments-profiling/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Mi app de Mac va lenta al abrir un proyecto. Graba una traza de rendimiento y muéstrame dónde se va el tiempo.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
El agente graba una traza con la herramienta de línea de comandos xctrace, asociada al binario correcto de la app, y abre el resultado en Instruments para analizar las pilas.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
Instruments Profiling (macOS/iOS)
Use this skill when the user wants performance profiling or stack analysis for native apps.
Focus: Time Profiler, xctrace CLI, and picking the correct binary/app instance.
Quick Start (CLI)
- List templates:
xcrun xctrace list templates - Record Time Profiler (launch):
xcrun xctrace record --template 'Time Profiler' --time-limit 60s --output /tmp/App.trace --launch -- /path/To/App.app
- Record Time Profiler (attach):
- Launch app yourself, get PID, then:
xcrun xctrace record --template 'Time Profiler' --time-limit 60s --output /tmp/App.trace --attach <pid>
- Open trace in Instruments:
open -a Instruments /tmp/App.trace
Note: xcrun xctrace --help is not a valid subcommand. Use xcrun xctrace help record.
Picking the Correct Binary (Critical)
Gotcha: Instruments may profile the wrong app (e.g., one in /Applications) if LaunchServices resolves a different bundle.
Use these rules:
- Prefer direct binary path for deterministic launch:
xcrun xctrace record ... --launch -- /path/App.app/Contents/MacOS/App
- If launching
.app, ensure it’s the intended bundle:open -n /path/App.app- Verify with
ps -p <pid> -o comm= -o command=
- If both
/Applications/App.appand a local build exist, explicitly target the local build path. - After launch, confirm the process path before trusting the trace.
Command Arguments (xctrace)
--template 'Time Profiler': template name fromxctrace list templates.--launch -- <cmd>: everything after--is the target command (binary or app bundle).--attach <pid|name>: attach to running process.--output <path>:.traceoutput. If omitted, file saved in CWD.--time-limit 60s|5m: set capture duration.--device <name|UDID>: required for iOS device runs.--target-stdout -: stream launched process stdout to terminal (useful for CLI tools).
Exporting Stacks (CLI)
- Inspect trace tables:
xcrun xctrace export --input /tmp/App.trace --toc
- Export raw time-profile samples:
xcrun xctrace export --input /tmp/App.trace --xpath '/trace-toc/run[@number="1"]/data/table[@schema="time-profile"]' --output /tmp/time-profile.xml
- Post-process in a script (Python/Rust) to aggregate stacks.
Instruments UI Workflow
- Template: Time Profiler
- Use “Record” and capture the slow path (startup vs steady-state)
- Call Tree tips:
- Hide System Libraries
- Invert Call Tree
- Separate by Thread
- Focus on hot frames and call counts
Gotchas & Fixes
- Wrong app profiled: LaunchServices resolves installed app instead of local build.
- Fix: use direct binary path or
--attachwith known PID.
- Fix: use direct binary path or
- No samples / empty trace: App exits quickly or never hits work.
- Fix: longer capture, trigger workload during recording.
- Privacy prompts:
xctracemay need Developer Tools permission.- Fix: System Settings → Privacy & Security → Developer Tools → allow Terminal/Xcode.
- Large XML exports:
time-profileexports are huge.- Fix: filter with XPath and aggregate offline; don’t print to terminal.
iOS Specific Notes
- Device: use
xcrun xctrace list devicesand--device <UDID>. - Launch via Xcode if needed; attach with
xctrace --attach. - Ensure debug symbols for meaningful stacks.
Verification Checklist
- Confirm trace process path matches target build.
- Confirm stacks show expected app frames.
- Capture covers the slow operation (startup/refresh).
- Export stacks for automated diffing if optimizing.
Preguntas frecuentes
¿Por qué se podría perfilar la app equivocada?
La skill advierte de que macOS puede resolver otra copia de la app, por eso recomienda apuntar a la ruta exacta del binario.
¿Cuánto dura una grabación?
Los ejemplos usan un límite de tiempo, como 60 segundos.
¿Puede conectarse a una app que ya está abierta?
Sí. La skill describe cómo conectarse a un ID de proceso después de abrir la app.
Detalles
Descripción original del autor
Instruments/xctrace profiling: macOS/iOS traces, binaries, args, exports.
repo: steipete/agent-scripts
Popularidad
- Estrellas en GitHub
- 7,4 mil
- Posición en el ranking
- #13233
- Licencia
- MIT
- Actualizada
- 30/10/2026
Comentarios
- …
Más skills de este repositorio
beeper
7,4 milAyuda a tu agente a buscar en tu historial local de chats de Beeper para encontrar mensajes y averiguar a qué chat o contacto se refiere una pista vaga.
cloudflare-registrar
7,4 milAyuda a tu agente a consultar precios y disponibilidad de dominios en Cloudflare Registrar, y a registrar o listar dominios con un paso de confirmación.
codexbar
7,4 milAyuda a tu agente a consultar cuánto uso te queda en servicios de IA como Codex, Claude y Kimi, incluidos los límites, los créditos y las fechas de reinicio.
create-cli
7,4 milAyuda a tu agente a diseñar los comandos, opciones, textos de ayuda, salida y errores de una herramienta de línea de comandos, para que sirva tanto a personas como a scripts.
Skills parecidas
diffs
394 milPermite que tu agente genere un diff real y compartible de los cambios, como enlace de visualización o archivo de imagen, en lugar de un resumen escrito a mano.
coding-agent
394 milAyuda a tu agente a pasar un trabajo de programación grande a Codex, Claude Code u OpenCode como trabajador en segundo plano, y después revisar su progreso.
gh-issues
394 milAyuda a tu agente a encontrar incidencias de GitHub, elegir cuáles trabajar y abrir pull requests con correcciones, incluido el seguimiento de los comentarios de revisión.