You can now do that using chisel's visualize
lldb command. It's very straightforward to set up, and it's a debugger super-power that's particularly handy if you work with images a lot.
Once you've installed chisel, update your ~/.lldbinit
file and restart XCode. Then create a new breakpoint and add an action that uses the command to inspect an UIImage
1.

Under the hood, the new python based lldb command writes the image buffer into a timestamp-based PNG file under /tmp/xcode_debug_images
and then call system command open
to use the default app to open up the image.
Keep in mind that lldb
holds a strong reference to the data. So during your debug session, your app might appear to leak RAM. Remember to turn the breakpoint off when you are done.
Also, if you have a lot of images, you may not want to open them up all in Preview, which will freeze itself with more than 100 images. Comment this line off, and you should be fine:
https://github.com/facebook/chisel/blob/main/commands/FBVisualizationCommands.py#L60
On my M1 mac, the file is installed into /usr/local/opt/chisel/libexec/commands/FBVisualizationCommands.py