jazzedge
1/27/2018 - 5:53 PM

Swift - Device is locked error

See:https://stackoverflow.com/questions/26791477/xcode-device-locked-when-iphone-is-unlocked

As is mentioned in several answers, the device is locked message is actually referring to the device not trusting the MacBook. In my case, I think my phone defaulted to not trusting my computer after updating to iOS 10. Here are the steps that worked for me to reset the settings (this is the same process that is mentioned in the Apple support page in tehprofessors' answer):

Disconnect your device from your MacBook
On your device go to Settings > General > Reset, then tap Reset Location & Privacy
Plug your device back into your computer, and on the device you will be prompted to trust the computer. Tap trust.
Rebuild in XCode and the device locked error should disappear.