This is how I debug QGIS using VSCode on OSX. Previously I used this approach. But since then ptvsd
was deprecated and I also needed to install python modules backed by native C code. This is much easier to do in a conda based environment (actually, I didn't find a way to make it work with the official QGIS installer :-)).
Follow this description to get QGIS running in conda.
ptvsd is superseded by debugpy.
Acti