How to run diagnostics on iPhone? My iPhone currently has me stumped. It's an iPhone 6 running the latest iOS. I have a Mac running Yosemite and the latest iTunes. I can't figure out what's wrong, so a diagnostic method would be great. I've no access to a genius bar etc. 

Initially the wifi indicator stayed grey. Then there seemed to be weird charging issues. Then it had moments of shutting off (once it even came with a blue screen,) but this may be down to the charging. 
This all happened within a few hours. 

Then it went to charging with only the apple logo. I assumed I was screwed. 

A few days later (I was on vacation when all this went down,) I turned it on and it appeared to be working as normal, albeit with the wifi greyed. It allowed me to make a backup, which was nice.
I reset the network connections - no joy. 
I reset the other settings - no joy. 
I had to wait until later to completely restore the phone and by that time I was left with an unresponsive phone never making it beyond the apple logo. 

I connected to itunes and got nothing until putting it into DFU mode. iTunes picked it up and I tried a restore. Initially I got error 4013, then tried again and got 4005. I keep getting 4005 and can't get the phone off the "connect to iTunes" screen. 

Really don't know where my phone is at, so a diagnostics method would be great.
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.