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.
8
Answers
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.
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
And then re-open Xcode.
If you are using 2 xcode apps try deleting 1 old one might fix it
Just open Xcode, it will ask you to install some required additional components. That’s it.
It happens after updating Xcode or Mac OS.
Updating xcode then reopening it did it for me.
You are using Connect via Network. Uncheck it and use a Cable. Looks like some recent Issue in iOS 16
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.
Merging the current top-voted answer and the steps in the other question’s solution worked for me only:
rm -r ~/Library/Developer/Xcode/iOS DeviceSupport