问题
After the releases of SwiftUI and Apple’s new betas (macOS 10.15, iOS 13, and Xcode 11), I began developing an application built on the new technologies.
Development had gone smoothly, considering all the software and systems involved were in beta. However, upon trying to run the SwiftUI-based app on a real device (iPhone 8 Plus, running iOS 13 beta 2), the application refused to start, instead crashing on launch with a simple (lldb) in the Xcode debugger. The app had worked properly in the simulator, and Xcode has provided no helpful messages as to why the app will not run on a real device.
tl;dr after running successfully in the iOS 13 simulator, SwiftUI app crashes on launch on real iOS 13 device.
Thanks in advance!
回答1:
Thanks to matt!
It turns out the issue was just a bug in Xcode 11 beta 1, preventing SwiftUI-based apps from being testing on real devices. Upgrading to Xcode 11 beta 2 resolved the issue.
来源:https://stackoverflow.com/questions/56654995/ios-13-swiftui-app-crashes-upon-launch-on-real-device