iPhone connects and disconnects repeatedly
FYI: If you have this problem, there are some helpful suggestions here: https://www.ifixit.com/Answers/View/473839/iOS+devices+connecting+and+disconnecting+rapidly.
One of them, running 'sudo killall -STOP -c usbd' in the Terminal, worked for me.
(There is a very old question about this in the community, but it seems to be too old for me to add a comment to, so I'm posting this as a new question in case it helps anybody else.)