---
title: Metal developer workflows
framework: xcode
role: collectionGroup
path: xcode/metal-developer-workflows
---

# Metal developer workflows

Locate and fix issues related to your app’s use of the Metal API and GPU functions.

## Overview

Overview Metal comes with a comprehensive suite of advanced developer tools to help you debug and optimize your Metal apps. Runtime diagnostics You can enable API Validation when running your app to check for incorrect Metal API usage. For more information, see Validating your app’s Metal API usage. Enable Shader Validation when running your app to check for issues like out-of-bounds memory access, missing useResource calls, and stack overflows. For more information, see Validating your app’s Metal shader usage. The Metal Performance HUD offers a visual overlay to catch performance issues while your app is running. For more information, see Monitoring your Metal app’s graphics performance. Runtime performance analysis The Metal system trace tool in Instruments provides a visual timeline of the parallel work on the CPU and the GPU, and the memory usage of your Metal app.

You can begin profiling with the Game Performance template (see Analyzing the performance of your Metal app) or the Game Memory template (see Analyzing the memory usage of your Metal app). Advanced Metal debugging and profiling The Metal debugger in Xcode provides advanced tools for debugging and profiling your Metal app.

You can get summaries of your Metal workload with the Dependencies viewer and the Memory viewer, inspect individual resources, and selectively debug your shaders. For more information on debugging, see Investigating visual artifacts. In addition, you can optimize your Metal app by drilling down performance bottlenecks with the Performance timeline and the per-line shader profiling results. For more information on profiling, see Optimizing GPU performance. Learn more about Metal debugger.

## Topics

### Project preparation for debugging

- [Building your project with embedded shader sources](xcode/building-your-project-with-embedded-shader-sources.md)
- [Naming resources and commands](xcode/naming-resources-and-commands.md)
- [Creating and using custom capture scopes](xcode/creating-and-using-custom-capture-scopes.md)

### Runtime diagnostics

- [Inspecting live resources at runtime](xcode/inspecting-live-resources-at-runtime.md)
- [Validating your app’s Metal API usage](xcode/validating-your-apps-metal-api-usage.md)
- [Validating your app’s Metal shader usage](xcode/validating-your-apps-metal-shader-usage.md)
- [Monitoring your Metal app’s graphics performance](xcode/monitoring-your-metal-apps-graphics-performance.md)
- [Customizing the Metal Performance HUD](xcode/customizing-metal-performance-hud.md)
- [Understanding the Metal Performance HUD metrics](xcode/understanding-metal-performance-hud-metrics.md)
- [Gaining performance insights with the Metal Performance HUD](xcode/gaining-performance-insights-with-metal-performance-hud.md)
- [Generating performance reports with the Metal Performance HUD](xcode/generating-performance-reports-with-metal-performance-hud.md)

### Counters

- [Finding your Metal app’s GPU occupancy](xcode/finding-your-metal-apps-gpu-occupancy.md)
- [Reducing shader bottlenecks](xcode/reducing-shader-bottlenecks.md)
- [Measuring the GPU’s use of memory bandwidth](xcode/measuring-the-gpus-use-of-memory-bandwidth.md)

## See Also

### Graphics

- [Metal debugger](xcode/metal-debugger.md)
