I found this to work quite reliably when it inevitably stops working.
Clean build. (Cmd + Shift + K)
Go to window > Devices and Simulators
Right click the device and unpair the iPhone
Unplug the iPhone
Quit Xcode
Reopen Xcode
Open Devices and Simulators again
Replug iPhone + Unlock and Trust the computer
It seems to have a better chance of working after this