I fixed this by:
Deleting the current iOS version in my folder that's related to my device.
~/Library/Developer/Xcode/iOS DeviceSupport
Restart Xcode and wait a little bit for it to refresh and copy cache files in my case then Run.
Based on this article in Stack it's ok to delete the iOS supported version. Can I delete from the iOS DeviceSupport?
I noticed when I did it and reconnected my device it re-downloaded the iOS device Support files.
If the support files don't download and the cache files are not copying, try restarting your computer as well.
I started also getting this error:
Errors were encountered while preparing your device for development.
Please check the Devices and Simulators Window.
Restart your phone and reconnect it to the compter if this happens. Then you should get a message in Xcode saying:
Preparing your phone for development.
/----------------2nd solution-------------/
- Unpair the device in Xcode.
- Clean the project.
- Unplug and then restart iPhone.
- Restart Xcode.
/-------------Update---------------------/
None of the above worked but I was able to run the program be re enabling
Connect via Network
After doing this now I can run project via USB...
I have submitted this bug to Apple.
/-----------Result from bug report--------------------/
Apple also suggests this can be caused by faulty data cords. Maybe try another cord as well.
/-----------------------------------------/