BumpyClock/agent-templates / skills/ios-macos-development
ios-macos-development
FlaggedBuild, debug, or release iOS and macOS apps with Swift and Apple platform tools.
native-app-performance/scripts/record_time_profiler.sh
View on GitHub#!/usr/bin/env bash
set -euo pipefail
# Minimal CLI wrapper for Time Profiler recording via xctrace.
# Supports attach or launch and always writes a .trace output.
usage() {
cat <<'USAGE'
Usage:
record_time_profiler.sh --attach <pid> --trace <path> [--duration 90s]
record_time_profiler.sh --launch <binary> --trace <path> [--duration 90s]
USAGE
}
attach_pid=""
launch_cmd=""
trace_path=""
duration="90s"
while [[ $# -gt 0 ]]; do
case "$1" in
--attach)
attach_pid="$2"; shift 2 ;;
--launch)
launch_cmd="$2"; shift 2 ;;
--trace)
trace_path="$2"; shift 2 ;;
--duration)
duration="$2"; shift 2 ;;
-h|--help)
usage; exit 0 ;;
*)
echo "Unknown arg: $1"; usage; exit 1 ;;
esac
done
if [[ -z "$trace_path" ]]; then
echo "--trace is required"; usage; exit 1
fi
if [[ -n "$attach_pid" && -n "$launch_cmd" ]]; then
echo "Use either --attach or --launch, not both"; exit 1
fi
if [[ -z "$attach_pid" && -z "$launch_cmd" ]]; then
echo "Must supply --attach or --launch"; usage; exit 1
fi
if [[ -n "$attach_pid" ]]; then
xcrun xctrace record --template 'Time Profiler' --time-limit "$duration" \
--output "$trace_path" --attach "$attach_pid"
else
xcrun xctrace record --template 'Time Profiler' --time-limit "$duration" \
--output "$trace_path" --launch -- "$launch_cmd"
fi
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 318k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 318k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 318k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |