How to fix "libobjc.A.dylib is being read from process memory" error
Table of Contents
If your app takes forever to run on a device and you get the following error in the console log, I can share a solution that solves the problem for me.
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.
Cause of the problem
LLDB, a debugger in Xcode, will copy and cache a necessary binary from a device to make a debugging process faster.
Xcode copies them to ~/Library/Developer/Xcode/iOS\ DeviceSupport
.
If the process fails, then LLDB has to fallback to reading information from the device, which causes slowness each time you run an app.
I don't know what caused the copy process to fail since it might have come from many reasons.
- I suspected it might come from the Xcode beta I downloaded.
- It might cause by the fact that I manually remove things in the
Developer
folder to get back my spaces and cause some files to be corrupt.
For whatever reason, the cache was corrupted, and Xcode couldn't retrieve the necessary information.
You can easily support sarunw.com by checking out this sponsor.
Debug 10x faster with Proxyman: Your ultimate tool to capture HTTPs requests/ responses, natively built for your iPhone and macOS. Special deal for Black Friday: Get 30% off for all Proxyman licenses with code “BLACKFRIDAY2024”.
How to fix "libobjc.A.dylib is being read from process memory" error
To fix this problem, we need to clean up a corrupted file inside ~/Library/Developer/Xcode/iOS\ DeviceSupport
.
Here are the steps:
- Close Xcode,
- Use the following command to remove the cache.
rm -r ~/Library/Developer/Xcode/iOS\ DeviceSupport
- Reopen Xcode and rerun the app. Xcode would find no cache this time because we just deleted them. It will copy the binaries again, which fixes the problem in my case.
Read more article about Xcode, Debugging, or see all available topic
Enjoy the read?
If you enjoy this article, you can subscribe to the weekly newsletter.
Every Friday, you'll get a quick recap of all articles and tips posted on this site. No strings attached. Unsubscribe anytime.
Feel free to follow me on Twitter and ask your questions related to this post. Thanks for reading and see you next time.
If you enjoy my writing, please check out my Patreon https://www.patreon.com/sarunw and become my supporter. Sharing the article is also greatly appreciated.
Become a patron Buy me a coffee Tweet ShareHow to convert between NSAttributedString and AttributedString
SwiftUI lacks the support for the old NSAttributedString but fully supports this new type. On the other hand, UIKit supported NSAttributedString but lacked the support of AttributedString in most APIs. Learn how to convert between the two, so you can use any of them in the platform you want.
How to convert Degrees to Radians in Swift
In this article, we will learn different ways to convert Degrees to Radians in iOS.