Xcode 14b2 Previews with SPM: AppHostMustHaveGetTaskAllowError: XCPreviewAgent.app not code signed properly "XCPreviewAgent.app" must be code signed in order to use on-device previews. Check your code signing settings for the target. com.apple.dt.U

I'm trying to use Previews in a Swift Package in Xcode 14b2 but it's not working (it was working in Xcode 13). I have the following error message but I don't know how to solve it.

"XCPreviewAgent.app" must be code signed in order to use on-device previews. Check your code signing settings for the target.

com.apple.dt.UVPreviewAgent-watchOS.watchkitapp {
    url: file:///Applications/Xcode-beta.app/Contents/Developer/Platforms/WatchOS.platform/Developer/Library/Xcode/Agents/XCPreviewAgent.app
    version: 20.0.32.2
    attributes: [
        ObjectIdentifier(0x00000001638e5d18): ["OS_ACTIVITY_DT_MODE": "YES", "SQLITE_ENABLE_THREAD_ASSERTIONS": "1"],
    ]
}

Hi,

Sorry to hear you are having problems getting previews working. Best next step will be to file a feedback with diagnostics.

When you get an error in Xcode Previews, an error banner appears in the canvas

  1. Click the "Diagnostics" button in that banner (or if the banner is missing you can use the menu: Editor > Canvas > Diagnostics)
  2. In the sheet that appears, click "Generate Report" in the bottom left of the sheet
  3. Attach (or make from the folder) the resulting zip file to the bug (will be named something like previews-diagnostics-0123456789.zip)
Xcode 14b2 Previews with SPM: AppHostMustHaveGetTaskAllowError: XCPreviewAgent.app not code signed properly "XCPreviewAgent.app" must be code signed in order to use on-device previews. Check your code signing settings for the target. com.apple.dt.U
 
 
Q