iOS

How to fix “expression produced error: error: Couldn’t realize type of self. Try evaluating the expression with -d run-target”

Recently while using command po to debug on Xcode 12.5, I encounter the following error:

expression produced error: error: Couldn't realize type of self. Try evaluating the expression with -d run-target

After searching I’ve found a thread talking about this problem. It turns out po is not stable and usually produce error. Instead you should use command p or expr.

Here it is, directly from the source:

po is a hard habit to break, I’ll admit, but it’s not always the right choice. We gave a great talk about this at WWDC a few years back, namely WWDC 2019 Session 429 LLDB Beyond “po”. The problem with po is that it has to run code in the inferior, and that’s a tricky task that can trigger all sorts of failures

Leave a Reply

Your email address will not be published. Required fields are marked *