A nice feature of using SwiftUI for your app is Preview macros which allow you to live preview individual views in the IDE. This can be super useful for rapid iteration if you properly mock out datasources and dependencies of your view. Passing less data to your views and modularizing them also improves general testability and performance.

What I didn’t realize until recently is that you can also use these previews on a physical device. Including via wireless debugging, so your iPhone/iPad doesn’t need to be connected to your Mac. I specifically wanted to do this because of some keyboard weirdness in the simulator, but this is generally useful.

SwiftUI preview device selection menu

Unfortunately I ran into some provisioning errors when I tried to set this up.

"This app cannot be installed because its integrity could not be verified"
NSLocalizedRecoverySuggestion=Failed to install embedded profile

This StackOverflow post has some debugging tips. But my issue ended being solved by first running the full App itself on the device. Then previewing views worked as expected. There must be some provisioning profile bootstrapping that happens there, which I couldn’t find documented anywhere.