कंटेंट पर जाएँ
TakoAPI
स्किल्स पर वापस

instruments-profiling

steipete द्वारा

iOS & macOS Development
1.9kclawskills.sh द्वारा बताए गए डाउनलोड
3स्टार
0व्यूज़
0 लाइकइस स्किल को लाइक करने के लिए साइन इन करें
—अभी तक कोई रेटिंग नहीं
आपकी रेटिंग

संक्षिप्त

Use when profiling native macOS or iOS apps.

विवरण

यह स्किल क्या करती है

Covers performance profiling for native macOS and iOS apps using xctrace CLI and the Instruments UI. Addresses correct binary selection, CLI arguments, stack exports, and common gotchas like LaunchServices resolving the wrong app bundle.

Instruments and xctrace have non-obvious argument ordering and bundle-resolution gotchas that cause silent profiling errors; this skill documents the fixes directly.

इसे कब इस्तेमाल करें

  • Profiling slow app startup on macOS
  • Capturing CPU samples from a running iOS app by PID
  • Exporting time-profile stacks to XML for offline analysis
  • Identifying hot frames in a native app's call tree
  • Attaching a profiler to a live process without restarting it

उदाहरण वर्कफ़्लो

इनपुट

User asks: how do I profile my macOS app's startup with xctrace?

एजेंट
  1. 1

    Run xcrun xctrace list templates to confirm Time Profiler is available

  2. 2

    Locate the direct binary path to avoid LaunchServices resolving an installed bundle instead of the local build

  3. 3

    Run xcrun xctrace record --template 'Time Profiler' --time-limit 60s --output /tmp/App.trace --launch -- /path/App.app/Contents/MacOS/App

  4. 4

    Verify the traced process path matches the intended build using ps -p <pid> -o comm= -o command=

  5. 5

    Open the trace with open -a Instruments /tmp/App.trace and review the call tree with Invert Call Tree and Hide System Libraries

आउटपुट

A .trace file opened in Instruments showing CPU samples and hot frames covering the app's startup path

आवश्यकताएँ

  • Xcode installed (provides xctrace CLI and Instruments)
  • Developer Tools permission granted in System Settings → Privacy & Security → Developer Tools

इंस्टॉलेशन

clawhub install steipete/instruments-profiling

CLI कमांड चलाएँ, या प्रॉम्प्ट को Claude Code, Cursor, Codex या जो भी कोडिंग एजेंट आप इस्तेमाल करते हैं उसमें पेस्ट करें।

लिंक