I am new in iOS. I update
Could not launch my app (unable to attach).
You are not doing anything wrong; it happens from time to time. There is no need to clear data and restart the Mac. Just try the following:
Unplug and plug the device back in.
If still happens, restart Xcode.