How to debug an IOS app on your iphone?

Is there a way to debug straight to your iphone, instead of using the emulator?

You can build the app with AdHoc deployment and see logs if you write to them when it is plugged into you computer/Xcode

Plug in your iPhone to your Mac, start Xcode, select “Menu => Windows => Devices and Simulators”. Select your device from the list and click on “View Device Logs”.

Date/Time: 2018-09-12 00:00:00 +0200
OS Version: iPhone OS 11.4.1 (Build 15G77)
Architecture: arm64
Report Version: 19

Event: disk writes
Action taken: none
Start time: 2018-09-12 00:00:00 +0200
End time: 2018-09-13 00:00:00 +0200
Duration: 86400s
Steps: 252 (10.5 MB/step)

Hardware model: iPhone10,6
Active cpus: 6

Binary Images:
1 libxpc.dylib <05E40D46-2111-3A32-A4CD-B7AFC770B119> /usr/lib/system/libxpc.dylib
2 <062BD1C4-0293-3010-B791-EB1A4D4DC93B>
3 libsystem_pthread.dylib <07C87E38-74B7-3D12-8F0F-A331D8894B97>

Another example for a crash:

22:42:41 +0200 DST [rm] reset: reason=** baseband crash detected;uptime=0;count=2;