Developer iPhone keeps disconnecting

My iPhone 7 running iOS 11 doesn't stay conneted to my laptop. It keeps disconnecting and connecting. It happens very periodically so I think it might be a software issue. The same cable works when I charge the phone. I tried two different cables and they both charge fine but when I plug it in to my Macbook Air, it does the "disconnecting/connecting" thing again.

Background.

  • I am running macOS Sierra 10.12.6.
  • My iPhone used to connect to my laptop no problem.
  • I recently signed up for a Developer account and installed an app through XCode
  • I also have a problem with finding the "Profile and Device Management" settings on my iPhone to trust my developer account, but that might be unrelated.

Sometimes it works and sometimes it doesnt. It might be related to the charge level.

Developer iPhone keeps disconnecting
 
 
Q