---
title: Capturing Metal commands programmatically
framework: metal
role: sampleCode
role_heading: Sample Code
path: metal/capturing-metal-commands-programmatically
---

# Capturing Metal commands programmatically

Invoke a Metal frame capture from your app, then save the resulting GPU trace to a file or view it in Xcode.

## Overview

Overview note: This sample code project is associated with WWDC 2019 session 606: Delivering Optimized Metal Apps and Games. Configure the sample code project To run the app: Build the project with Xcode 11 or later.

## See Also

### Developer tools

- [Supporting Simulator in a Metal app](metal/supporting-simulator-in-a-metal-app.md)
- [Logging shader debug messages](metal/logging-shader-debug-messages.md)
- [Developing Metal apps that run in Simulator](metal/developing-metal-apps-that-run-in-simulator.md)
- [Improving your game’s graphics performance and settings](metal/improving-your-games-graphics-performance-and-settings.md)
- [Metal debugger](xcode/metal-debugger.md)
- [Metal developer workflows](xcode/metal-developer-workflows.md)
- [GPU counters and counter sample buffers](metal/gpu-counters-and-counter-sample-buffers.md)
- [Metal debugging types](metal/metal-debugging-types.md)
