I'm sharing my solution here because I tried every suggestion until something else occurred to me:
My Mac was running a VPN, and that was preventing Xcode from recognizing my iPhone. I simply turned off the VPN, and voilà—my iPhone reappeared in the list of available devices.
If you're facing connection issues or problems adding your device, double-check whether a VPN might be the culprit.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: