7

Since upgrading my iPhone to iOS 15 and upgrading to Xcode 13 on my Mac, I have a problem with testing/debugging ANY SwiftUI app using Xcode. Even a new Xcode project with the simple "hello world" example behaves this way when the Xcode "Start" button is pressed (whether or not the target is a simulator or my physical iPhone with iOS 15).

The app seems to be correctly uploaded to the target but the target then displays a blank white screen for more than a minute (minutes) before displaying app screen.

When Xcode debugger is disconnected after that and the app is manually started on the target (whether simulator or physical iPhone), it seems to work fine (without any white screen appearing first).

Same behavior with all my SwiftUI apps (& simple Xcode Swift "Hello World" example)which have worked for a long time without any problems.

I still have Xcode 12.5 installed & it now exhibits the same behavior (even when target OS is iOS 14.5) and app is uploaded to my iOS 15 iPhone.

It is basically impossible to test & debug apps with this problem.

Has anyone else had this problem?

Any known solution or suggestions?

Thanks!

Gerard
  • 1,807
  • 4
  • 13
  • 20
  • 2
    Just installed xCode 13.1 release candidate. Still have the same problem. Sooooo irritating - really makes debugging (or simply loading an app on a physically attached device) almost impractical (from a time wasted point of view). – Gerard Oct 21 '21 at 22:59
  • Did you find a solution to this? – Arjun Dec 03 '21 at 11:05

4 Answers4

2

Just installed iOS v15.0.2 on my iPhone (Model: X). The problem was magically resolved after this iOS update!

When I reconnected my iPhone (to xCode on Mac) after this latest iOS update, I had to wait a few minutes for Xcode to complete "Fetching iPhone debug symbols from iPhone". Once that completed, Xcode once again launched any App (& connected it to debugger) immediately (as was the case before my iOS 15.0 update to iPhone) - without any blank screen and no more minutes long delay! So my whole Xcode development environment seems to be back to normal after this iOS update.

So the frustration & irritation seems to be over!

Gerard
  • 1,807
  • 4
  • 13
  • 20
2

Try to delete iOS DeviceSupport folder, it must help debug on real device.

rm -r ~/Library/Developer/Xcode/iOS\ DeviceSupport
Anonimys
  • 596
  • 1
  • 5
  • 14
0

It depends on the mobile OS version, not Xcode

Sword
  • 1
  • 1
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/30708962) – Dylan Lacey Jan 05 '22 at 00:06
0
extension UIApplication {
    func getKeyWindow() -> UIWindow? {
        if #available(iOS 13.0, *) {
            return connectedScenes
                .filter { $0.activationState == .foregroundActive }
                .compactMap { $0 as? UIWindowScene }
                .flatMap { $0.windows }
                .first { $0.isKeyWindow }
        } else {
            return keyWindow
        }
    }
}

I'm wondering if it's because on iOS15, the keywindow is obtained when the app starts, .activationState == .foregroundInactive

If so, just remove the line

.filter { $0.activationState == .foregroundActive }

Forus
  • 36
  • 5