Search code examples
swiftuipreview

SwiftUI - preview stopped working on one specific device


I was using the iPhone 11 preview until I made some changes to CoreData - now I'm getting a persistent store migration error. If I switch to a different preview profile, everything works as expected.

My question is, how do I reset the iPhone 11 profile? In the simulator I would just erase the app and start over. But I'm not sure how to do that with Canvas. Thanks!


Solution

  • I finally came across the solution, thanks to @Monica Granbois.

    First delete:

    ~/Library/Developer/Xcode/UserData/Previews/Simulator Devices/
    

    Then run this line at the terminal:

    killall -9 com.apple.CoreSimulator.CoreSimulatorService