I also had this problem, and I had Developer Mode turned on. But after upgrading to iOS 17 my phone wouldn't connect to XCode 15.0.1. I turned off Developer Mode and turned it back on. After following all of the prompts. After the restart of my phone, it connected to XCode.