I was searching this to test a webapp. I wanted to output "console logs" from mobile safari so that I could test multi-touch gestures were working as expected.
It is possible to get console logs sent from an iOS safari to a Mac desktop safari if you link your phone with a cable and allow it in the ios safari advanced settings. This article describes how: https://academy.test.io/en/articles/3040678-browser-console