Analyze the reason: This problem occurs because XCode 8 cannot access the phone because the “untrust” option is clicked on the iOS device when connecting to the MAC for the first time
Solution:
Students who are good at English can see the original article
http://stackoverflow.com/questions/26791477/xcode-device-locked-when-iphone-is-unlocked
Let me talk about the method below
This is the explanation of APPLE official website
https://support.apple.com/en-us/HT202778
The point is this paragraph
Change your settings for trusted computers
Your iOS device remembers the computers you’ve chosen to trust.
If you don’t want to trust a computer or other device anymore, change the privacy settings on your iPhone, iPad, or iPod touch: In iOS 8 or later, tap Settings > General > Reset > Reset Location & Privacy. Now when you connect to formerly trusted computers, the Trust alert will ask you whether you trust that computer.
Means to reset privacy settings
Click Settings –> General –> Reset –> Reset location and privacy
Then close xcode 8, unplug the data cable, restart xocde 8 to start the project, and plug the data cable again. At this time, the mobile phone will display the connection access permissions of the mac and the mobile device, select “Trust”, and you are done.