I can’t work out how to debug a preview in Xcode 13.
Documentation for Xcode 11 and Xcode 12 has conflicting advice like
- right click the run button and you’ll get a menu
- control/command/option click run
- long click the run
I’ve tried it all – and put breakpoints on almost every line of code in my preview / view / init functions – and however I hit run, it just… runs… – so I see the preview, but no breakpoints are hit – no print statements come out in the console – no cool expanded ui display appears – and no menus appear.
Any ideas?
2
Answers
It looks like Apple has chosen to remove the ability to debug Xcode Previews in Xcode 13 with no guidance as to if/when it will be brought back.
https://developer.apple.com/forums/thread/683773
You can attach the Debugger to the Preview Process like explained here