In LLDB version 1000.11.37.1 (the version that’s packaged with Xcode 10.0), there’s a bug in LLDB that incorrectly imports the wrong headers when debugging an iOS Simulator or iOS target. Fortunately, this bug only appears when running in a Terminal session.
To see if you’re affected, open up a Terminal window and check your LLDB version:
(lldb) version
lldb-1000.11.37.1
Swift-4.2
If you have the same version (or maybe one coming from Xcode 10.1/10.2) this will happen when debugging any iOS Simulator application:
(lldb) po @import UIKit
error: while importing modules:
error: Header search couldn't locate module UIKit
This is because LLDB is looking in the MacOS SDK directory for the UIKit headers. This also means many LLDB scripts which rely on this feature will also fail.
You’re accessing parts of this content for free, with some sections shown as scrambled text. Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.