I have some nice dummy data built out for my previews and don’t want to have to replicate it on the simulator or my personal device (where I use the app myself with my own data)… How can I screenshot the preview window? Ideally would like to use it for App Store templates I’ve built in Figma.
Question posted in Xcode
Whether you're new to Xcode or an experienced developer, our archive has everything you need to know about this integrated development environment (IDE). From basic functionalities to advanced features, our archive covers a wide range of Xcode-related questions and answers. Browse our archive now and find solutions to your Xcode questions, and take your app development skills to the next level
Whether you're new to Xcode or an experienced developer, our archive has everything you need to know about this integrated development environment (IDE). From basic functionalities to advanced features, our archive covers a wide range of Xcode-related questions and answers. Browse our archive now and find solutions to your Xcode questions, and take your app development skills to the next level
2
Answers
You can change the preview device to your physical device and it will show the preview on your phone with the exact data that is in the Preview. Use the dropdown in the bottom left corner to select your phone. Now you can take screenshots on your physical device.
Xcode 15 and above
Xcode 14 and below
There is now option in Xcode 15.3 for doing so. Simply Go to Editor -> Canvas then select either Export Preview Screenshot or Export Preview Screenshot.