I create a new project using SwiftUI. Live preview using Xcode works fine. Deploy the app to real device (iPhone XR) over wifi works fine. However, I ran into PreviewUpdateTimedOutError when trying to "live preview on device".
PreviewUpdateTimedOutError: Updating took more than 5 seconds
Sometimes I get this error in the Xcode preview canvas and all I had to do was press Try Again and it would rebuild without an error.
If there is a subsequent error, it is likely because of the code or that preview is actually crashing due to an error that you would need to work out.
I wouldn’t worry about this particular error, though Apple should fix this soon or at least provide a more descriptive reason as to why the preview crashes.
There are some people who have posted about this error online who have found a fix for it, so I would recommend you have a look at these.
The bottom line is that this is not the error you need to be concerned about; there is likely another error (in the code or elsewhere) that is your main problem.
If there is a subsequent error, it is likely because of the code or that preview is actually crashing due to an error that you would need to work out.
I wouldn’t worry about this particular error, though Apple should fix this soon or at least provide a more descriptive reason as to why the preview crashes.
There are some people who have posted about this error online who have found a fix for it, so I would recommend you have a look at these.
The bottom line is that this is not the error you need to be concerned about; there is likely another error (in the code or elsewhere) that is your main problem.
@BabyJ
Hi, thank you for the reply.
I have searched many places online and tried out their suggestions. However, the error persists.
I have pressed the "try again" button, disconnected the phone and reconnect again (via cable, and wifi). The project is newly created with the "hello world" ContentView.swift.
I really need this features because I start coding for my app on a MacBook Air (dual cores) that I would like to minimize the processing on the device. I think that having the live preview on the real device would relief the MacBook from running a simulator.
Moreover, the app that I am building require a camera, which only able to test on a real device. For now, I have to build the app and test on the device. Is this the normal way to do it, or I could "live preview" the app?
Hi, thank you for the reply.
I have searched many places online and tried out their suggestions. However, the error persists.
I have pressed the "try again" button, disconnected the phone and reconnect again (via cable, and wifi). The project is newly created with the "hello world" ContentView.swift.
I really need this features because I start coding for my app on a MacBook Air (dual cores) that I would like to minimize the processing on the device. I think that having the live preview on the real device would relief the MacBook from running a simulator.
Moreover, the app that I am building require a camera, which only able to test on a real device. For now, I have to build the app and test on the device. Is this the normal way to do it, or I could "live preview" the app?
On your point about live previewing on device, I am currently having issues with this (see my post about this).
In theory, if Xcode lets you preview on device, you should be able to view what's in the preview canvas on your device and interact with it as normal - this includes using the camera.
I'm not sure why you keep getting the error, so if you haven't found anything to solve this elsewhere you should probably file a feedback report and attach the diagnostics from Xcode linked to the error.
In theory, if Xcode lets you preview on device, you should be able to view what's in the preview canvas on your device and interact with it as normal - this includes using the camera.
I'm not sure why you keep getting the error, so if you haven't found anything to solve this elsewhere you should probably file a feedback report and attach the diagnostics from Xcode linked to the error.