Unable to use po command in console (debug area)
lldb has changed in Xcode 10.2. Apple recommends use of 'p' or more recently 'v' to view the values of variables.
from the Xcode 10.2 Release Notes
The LLDB debugger has a new command alias, v, for the “frame variable” command to print variables in the current stack frame. Because it bypasses the expression evaluator, v can be a lot faster and should be preferred over p or po. (40066460)
There is also good information on this in the LLDB Tutorial in the section named Examining Stack Frame State.
The frame variable command will also perform "object printing" operations on variables (currently we only support ObjC printing, using the object's "description" method. Turn this on by passing the -o flag to frame variable:
(lldb) frame variable -o self
(SKTGraphicView *) self = 0x0000000100208b40
<SKTGraphicView: 0x100208b40>
po command in Xcode does not generate output
Silly me, I was in the 'Target Output' window instead of the 'Debugger Output' window.
Somehow I thought I checked the other console windows there, but apparently I didn't.
How to access 'self' in Console in Xcode 7.3
You can check the values of properties and variables using po [self variablename]
in console window. This way you can easily access the variables.
Also you can check with other projects weather the problem is with xcode or in your project configurations.
You can also expand the collapsed value in debug area. if it's expanding then you can access values by simply using po variablename
otherwise you need to use po [self variablename]
.
What's the difference between p and po in Xcode's LLDB debugger?
Strip debug symbols during copy
In most answers they advice to set optimization to "none" but forget that this option should be set to NO (at least for debug configuration).
Useful Xcode DEBUG commands to use in console
You can find it in Apple documentation: Debugging with Xcode
or check this: https://developer.apple.com/library/content/documentation/IDEs/Conceptual/gdb_to_lldb_transition_guide/document/lldb-command-examples.html
Related Topics
How to Use " Let Newswiftcolor = Uicolor(Red: 255, Green: 165, Blue: 0, Alpha: 0)
Nsubiquityidentitydidchangenotification and Sigkill
What Is Correct Way to Notify View Controller from Appdelegate
Hls Metadata Id3 Tag Not Working
Swiftui: How to Change the Tint Color (Background Color) of a Navigationview
Supporting a Nsmanagedobject Fetchrequest() Class Method in iOS 9 and 10
Xcode 12.5 Missing Entitlement Com.Apple.Developer.Associated-Appclip-App-Identifiers
Giving Properties of a Uibutton to a Skspritenode in Spritekit
Timer Label Not Updated After Switching Views (Swift)
Fill Uiview with Color Based on Percentage
Changing Font Size in a Label for Only iPhone 4S, Is This Possible
Incorrect Position of Cashapelayer
Why the Autolayout Is Not Updated If I Use Ibdesignable File When I Run the App