52

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.

tdc
  • 521
  • 1
  • 3
  • 3
  • 2
    As a follow-up. The Apple Devs via the Feedback Assistant program have resolved this for me by getting me to run the following command in the terminal which deletes my Device details for debugging, to force Xcode to recreate them from scratch. `rm -r ~/Library/Developer/Xcode/iOS\ DeviceSupport ` – tdc Jun 17 '22 at 23:04

8 Answers8

91

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.

Shai Mishali
  • 9,224
  • 4
  • 56
  • 83
  • 10
    Did not work for me we had different issues. iOS 16 Xcode 14 flutter , but this did: https://stackoverflow.com/a/71115871/420259 – hunterp Sep 12 '22 at 22:16
  • 1
    I tried this but it seems not working for me , UI is getting stuck for 1.5 minutes and I am getting something like this 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. – Shakti Sep 19 '22 at 05:54
  • This just saved my life. I declined to install components on the first popup and could never re generate the popup or instance, has haunted me for about a month. – ctm Dec 02 '22 at 19:49
  • 3
    Make sure Xcode is CLOSED when you delete the files, at least that's what made this work for me – Thyselius Dec 14 '22 at 20:51
  • Instead of delete, you can always move the directory somewhere else temporarily. That's good general advice because if remove doesn't work, you can't revert. – thebiggestlebowski Aug 12 '23 at 10:13
26

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
choofie
  • 2,575
  • 1
  • 25
  • 30
15

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.

Jim Ingham
  • 25,260
  • 2
  • 55
  • 63
2

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.

1

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

It happens after updating Xcode or Mac OS.

intraector
  • 994
  • 10
  • 20
1

Updating xcode then reopening it did it for me.

las
  • 11
  • 1
0

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

Tower Jimmy
  • 567
  • 1
  • 4
  • 15
-1

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

MTVD
  • 1