tdc
tdc

Reputation: 591

Xcode 14 Beta - Build Issues with LLDB

I am having issues when building any app with an iPhone 11 Pro or iPad Pro as the physical device destination. A new instance of a standard template app with Hello World takes moments to build and install on the phone, but then the app freezes on a black screen. Console reports the following.

warning: libobjc.A.dylib is being read from process memory. This indicates that LLDB could not find the on-disk shared cache for this device. This will likely reduce debugging performance.

Interestingly, if I stop the build in Xcode, which quits the app on the device, then manually launch the app on the device, everything works as expected but no logging of course. Reverting back to Xcode 13.4, the same issue occurs suggesting its an iOS 16 beta issue?

Further testing suggests this is an issue with the debugger. If I allow Xcode to build and run an app to one of my devices, it will launch and then freeze on a black screen. After a few minutes the app progresses to its main ContentView and the console appears to then function as normal.

Any thoughts? Thanks.

Upvotes: 59

Views: 33372

Answers (8)

choofie
choofie

Reputation: 2863

Merging the current top-voted answer and the steps in the other question's solution worked for me only:

  1. rm -r ~/Library/Developer/Xcode/iOS\ DeviceSupport
  2. Open the Xcode project/workspace with your device connected
  3. Wait until the “Fetching debug symbols” process finished
  4. Close the Xcode
  5. Reopen the Xcode again and try to Build and Run on your device

Upvotes: 36

user19051554
user19051554

Reputation: 803

I had this issue while using flutter and iPhone. I fixed it by just running flutter clean and then flutter pub get in the terminal and worked. Incase any are having the issue while using flutter.

Upvotes: 3

Tower Jimmy
Tower Jimmy

Reputation: 567

You are using Connect via Network. Uncheck it and use a Cable. Looks like some recent Issue in iOS 16

enter image description here

enter image description here

Upvotes: 0

las
las

Reputation: 11

Updating xcode then reopening it did it for me.

Upvotes: 1

intraector
intraector

Reputation: 1456

Just open Xcode, it will ask you to install some required additional components. That's it.

It happens after updating Xcode or Mac OS.

Upvotes: 3

MTVD
MTVD

Reputation: 1

If you are using 2 xcode apps try deleting 1 old one might fix it

Upvotes: -1

Shai Mishali
Shai Mishali

Reputation: 9402

To those who bump into this later (or future-me) - I had the same issue.

Entirely removing the Device Support folder and re-opening Xcode forces it to recreate the device support files.

tl;dr

rm -r ~/Library/Developer/Xcode/iOS\ DeviceSupport

And then re-open Xcode.

Upvotes: 100

Jim Ingham
Jim Ingham

Reputation: 27228

More context:

lldb uses the gdb-remote protocol for reading memory from a device. This has the benefit of being a widely supported protocol, but it is not blazingly fast. So lldb will work much better if it has copies of the binaries that get loaded into your program on the local host where it can inspect them directly.

Xcode is the one that makes that happen. When you plug in a device and start up Xcode, if the OS is one Xcode hasn't seen before, it copies the system binaries over in one gulp and puts them in ~/Library/Developer/Xcode/{DeviceType} DeviceSupport/SystemVersion. If this process fails for some reason, then lldb will have to fall back to reading symbol information from the device, which is slow - that's what the warning is warning about.

If you delete the current version of the DeviceSupport directory, the next time you try to debug, Xcode will copy the binaries over again. If the error you had was transitory, then that should fix the problem. If not, it would be good to file a report with Apple Feedback to figure out what's actually going wrong.

Upvotes: 16

Related Questions