---
title: PreviewDevice
framework: swiftui
role: symbol
role_heading: Structure
path: swiftui/previewdevice
---

# PreviewDevice

A simulator device that runs a preview.

## Declaration

```swift
struct PreviewDevice
```

## Overview

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(_:) 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”

## Relationships

### Conforms To

- [ExpressibleByExtendedGraphemeClusterLiteral](swift/expressiblebyextendedgraphemeclusterliteral.md)
- [ExpressibleByStringLiteral](swift/expressiblebystringliteral.md)
- [ExpressibleByUnicodeScalarLiteral](swift/expressiblebyunicodescalarliteral.md)
- [RawRepresentable](swift/rawrepresentable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Customizing a preview

- [previewDevice(_:)](swiftui/view/previewdevice(_:).md)
- [previewLayout(_:)](swiftui/view/previewlayout(_:).md)
- [previewInterfaceOrientation(_:)](swiftui/view/previewinterfaceorientation(_:).md)
- [InterfaceOrientation](swiftui/interfaceorientation.md)
