When I tried to build and run, Xcode said my device was locked. I looked at my iPhone, and it\'s not locked at all. How do I fix this?
Lots of answers, but the one that worked for me (El Capitan, Xcode 8.2) was to close iTunes. If that has a connection to the IOS device then although Xcode can load the app components it will still fail to run it.