Failed to launch app in reasonable time Xcode 16

I've updated my computer to Sequoia 15, Xcode 16 and now no matter what I do, I am unable to work with Swift UI previews.

I get this error each time I try to run the preview:

Failed to launch app in reasonable time

I have done:

  1. Uninstall/Re-install Xcode
  2. Deleted derived data
  3. Deleted the simulator data
  4. Used DevCleaner to remove all data related to Xcode
  5. Searched all websites about this issue. ( Non shown a good solution )
  6. Write this question on here.

If anyone has found a solution, please let me know how you fixed it.

Answered by jshulman in 804193022

Same thing is happening to me. I set up an iOS 17.5 phone and chose it. That worked.

Accepted Answer

Same thing is happening to me. I set up an iOS 17.5 phone and chose it. That worked.

11

Thanks! this worked for me too.

What was the OS on the device when this failed? Can you gather diagnostics of the failure and file a feedback report?

I'm glad that picking an older phone got you past the issue. From what I can tell this is because this fell back to the legacy previews execution mode. We definitely still want to get the modern mode working for you so if you're able to some special diagnostics, we can investigate the root issue.

Steps to generate helpful diagnostics:

  1. Download and install the logging profile on all devices involved. Instructions and profiles are available here: https://developer.apple.com/bug-reporting/profiles-and-logs/?name=swift
  2. Reproduce the issue
  3. Click the "Diagnostics" button in the error banner in Previews' Canvas area (or if the banner is missing you can use the menu: Editor > Canvas > Diagnostics)
  4. In the sheet that appears, click "Generate Report" in the bottom left of the sheet
  5. Attach (or make from the folder) the resulting zip file to the bug report (will be named something like previews-diagnostics-0123456789.zip)

Generate the sysdiagnose(s) and attach those too.

I want to confirm the solution provided. I was facing a similar issue using iOS18 as minimum deployment in my application and downgrading to iOS 17 solved the problem

I am running macOS 15.0 (24A335) Xcode 16 for reference.

Facing the same problem. For us it seems to be related to the Project setup using Kotlin Multiplatform. Just downloading the example project from https://kmp.jetbrains.com/#newProject using native SwiftUI causes the same error. Maybe this has something to do with dynamic frameworks?

Damn… I need to user iOS 18

accepted answer works, but pls fix xcode

There's also a setting in Xcode 16:

Editor > Canvas > Use Legacy Previews Execution

This allowed me to use iOS 18 simulators for previews.

I've encountered the same issue and was able to track down the root cause.

The problem occurs if:

  • The project uses a library
  • The library contains an Objective C extension on a UIKit class with a load method that calls some other method

It doesn't seem to matter which method is called in load, anything seems to break previews.

I've shared an minimal example of the issue here:

https://www.icloud.com/iclouddrive/024UlszLOLDUPKFsKSllSK72g#FailedToLaunchApp

Steps to reproduce:

Open the PreviewLaunchExample.xcodeproj and try to show the Preview of the ContentView on any iOS 18 device. It will timeout with the error "Failed to launch app "PreviewLaunchExample.app" in reasonable time". The Preview does work when selecting a iOS 17.5 device, as others have reported in this thread.

Next, open Test.m in MyLibrary and comment out the line [self description]. Then test the Preview again. The Preview should work as expected.

Test setup: macOS 15.0, Xcode 16.0, OS 18 Simulator.

I was able to fix this by making sure all my targets, including test targets had exactly the same minimum deployment target. I had updated a couple of the targets to iOS 17 and left the test targets as they were.

Failed to launch app in reasonable time Xcode 16
 
 
Q