How to run diagnostics on iPhone?
The diagnostic function on an iphone does not appear to have a user-trigged capability.
Apple can invoke this remotely by pushing a Profile to your device, assuming that it can both boot up and is able to join a network.

The profile causes a new item to appear in

Settings ➔ Privacy ➔ Analytics

When you tap on this the tests run and immediately send the results back to a support agent and I presume they‘re recorded in a database somewhere too.