<!--
{
  "availability" : [
    "iOS: 13.0.0 - 27.0.0",
    "iPadOS: 13.0.0 - 27.0.0",
    "macCatalyst: 13.0.0 - 27.0.0",
    "macOS: 10.15.0 - 27.0.0",
    "tvOS: 13.0.0 - 27.0.0",
    "visionOS: 1.0.0 - 27.0.0",
    "watchOS: 6.0.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/PreviewDevice",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI13PreviewDeviceV"
  },
  "title" : "PreviewDevice"
}
-->

# PreviewDevice

A simulator device that runs a preview.

```
struct PreviewDevice
```

## Overview

Create a preview device by name, like “iPhone X”, or by model number,
like “iPad8,1”. Use the device in a call to the [`previewDevice(_:)`](/documentation/SwiftUI/View/previewDevice(_:))
modifier to set a preview device that doesn’t change when you change the
run destination in Xcode:

```
struct CircleImage_Previews: PreviewProvider {
    static var previews: some View {
        CircleImage()
            .previewDevice(PreviewDevice(rawValue: "iPad Pro (11-inch)"))
    }
}
```

You can get a list of supported preview device names by using the
`xcrun` command in the Terminal app:

```
% xcrun simctl list devicetypes
```

Additionally, you can use the following values for macOS platform
development:

- “Mac”
- “Mac Catalyst”

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)